/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.25 Revision 1.53
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
5<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml,v 1.25 2008/05/19 09:10:06 nightmorph Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml,v 1.53 2013/12/17 10:38:05 swift Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<abstract> 11<abstract>
12The Linux kernel is the core of every distribution. This chapter 12The Linux kernel is the core of every distribution. This chapter
13explains how to configure your kernel. 13explains how to configure your kernel.
14</abstract> 14</abstract>
15 15
16<version>6.3</version> 16<version>23</version>
17<date>2008-05-19</date> 17<date>2013-12-17</date>
18 18
19<section>
20<title>Timezone</title>
21<body>
22
23<p>
24You first need to select your timezone so that your system knows where it is
25located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy
26it to <path>/etc/localtime</path>. Please avoid the
27<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
28indicate the expected zones. For instance, <path>GMT-8</path> is in fact
29GMT+8.
30</p>
31
32<pre caption="Setting the timezone information">
33# <i>ls /usr/share/zoneinfo</i>
34<comment>(Suppose you want to use GMT)</comment>
35# <i>cp /usr/share/zoneinfo/GMT /etc/localtime</i>
36</pre>
37
38</body>
39</section>
40<section> 19<section>
41<title>Installing the Sources</title> 20<title>Installing the Sources</title>
42<subsection> 21<subsection>
43<title>Choosing a Kernel</title> 22<title>Choosing a Kernel</title>
44<body> 23<body>
45 24
46<p> 25<p>
47The core around which all distributions are built is the Linux kernel. It is the 26The core around which all distributions are built is the Linux kernel. It is the
48layer between the user programs and your system hardware. Gentoo provides its 27layer between the user programs and your system hardware. Gentoo provides its
49users several possible kernel sources. A full listing with description is 28users several possible kernel sources. A full listing with description is
50available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel 29available at the <uri link="https://wiki.gentoo.org/wiki/Kernel/Overview">Gentoo Kernel
51Guide</uri>. 30Guide</uri>.
52</p> 31</p>
53 32
54<p> 33<p>
55For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c> 34For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c>
56(kernel source patched for extra features). 35(kernel source patched for extra features).
83the best way to optimize your environment. 62the best way to optimize your environment.
84</p> 63</p>
85 64
86<p> 65<p>
87If you want to manually configure your kernel, continue now with <uri 66If you want to manually configure your kernel, continue now with <uri
88link="#manual">Default: Manual Configuration</uri>. If you want to use 67link="#manual">Default: Manual Configuration</uri>. If you want to use
89<c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using 68<c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
90genkernel</uri> instead. 69genkernel</uri> instead.
91</p> 70</p>
92 71
93</body> 72</body>
94</subsection> 73</subsection>
105couple of kernels you don't even remember that it was difficult ;) 84couple of kernels you don't even remember that it was difficult ;)
106</p> 85</p>
107 86
108<p> 87<p>
109However, one thing <e>is</e> true: you must know your system when you start 88However, one thing <e>is</e> true: you must know your system when you start
110configuring a kernel manually. Most information can be gathered by emerging 89configuring a kernel manually. Most information can be gathered by emerging
111pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now 90pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
112be able to use <c>lspci</c> within the chrooted environment. You may safely 91be able to use <c>lspci</c> within the chrooted environment. You may safely
113ignore any <e>pcilib</e> warnings (like pcilib: cannot open 92ignore any <e>pcilib</e> warnings (like pcilib: cannot open
114/sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run 93/sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
115<c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same. 94<c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
116You can also run <c>lsmod</c> to see what kernel modules the Installation CD 95You can also run <c>lsmod</c> to see what kernel modules the Installation CD
117uses (it might provide you with a nice hint on what to enable). 96uses (it might provide you with a nice hint on what to enable).
118</p> 97</p>
119 98
120<p> 99<p>
121Now go to your kernel source directory and execute <c>make menuconfig</c>. This 100Now go to your kernel source directory and execute <c>make menuconfig</c>. This
153strongly recommends users enable MCE features so that they are able to be 132strongly recommends users enable MCE features so that they are able to be
154notified of any hardware problems. On x86_64, these errors are not printed to 133notified of any hardware problems. On x86_64, these errors are not printed to
155<c>dmesg</c> like on other architectures, but to <path>/dev/mcelog</path>. This 134<c>dmesg</c> like on other architectures, but to <path>/dev/mcelog</path>. This
156requires the <c>app-admin/mcelog</c> package. Make sure you select IA32 135requires the <c>app-admin/mcelog</c> package. Make sure you select IA32
157Emulation if you want to be able to run 32-bit programs. Gentoo will install a 136Emulation if you want to be able to run 32-bit programs. Gentoo will install a
158multilib system (mixed 32-bit/64-bit computing) by default, so you probably 137multilib system (mixed 32-bit/64-bit computing) by default, so this option is
159want this option. 138required.
160</p> 139</p>
140
141<note>
142If you plan to use a non-multilib profile (for a pure 64-bit system), then you
143don't have to select IA32 Emulation support. However, you'll also need to follow
144the <uri link="?part=1&amp;chap=6#doc_chap2_sect2">instructions</uri> for
145switching to a <uri link="https://wiki.gentoo.org/wiki/AMD64/FAQ">non-multilib
146profile</uri>, as well as choosing the correct <uri
147link="?part=1&amp;chap=10#doc_chap2_sect2">bootloader</uri>.
148</note>
161 149
162<pre caption="Selecting processor type and features"> 150<pre caption="Selecting processor type and features">
163Processor type and features ---> 151Processor type and features --->
152 [ ] Machine Check / overheating reporting
164 [ ] Intel MCE Features 153 [ ] Intel MCE Features
165 [ ] AMD MCE Features 154 [ ] AMD MCE Features
166 Processor family (AMD-Opteron/Athlon64) ---> 155 Processor family (AMD-Opteron/Athlon64) --->
167 ( ) AMD-Opteron/Athlon64 156 ( ) Opteron/Athlon64/Hammer/K8
157 ( ) Intel P4 / older Netburst based Xeon
158 ( ) Core 2/newer Xeon
168 ( ) Intel EM64T 159 ( ) Intel Atom
169 ( ) Generic-x86-64 160 ( ) Generic-x86-64
170Executable file formats / Emulations ---> 161Executable file formats / Emulations --->
171 [*] IA32 Emulation 162 [*] IA32 Emulation
172</pre> 163</pre>
173 164
186 177
187</body> 178</body>
188<body> 179<body>
189 180
190<p> 181<p>
182Next select <e>Maintain a devtmpfs file system to mount at /dev</e> so that
183critical device files are already available early in the boot process.
184</p>
185
186<pre caption="Enabling devtmpfs support">
187Device Drivers ---&gt;
188 Generic Driver Options ---&gt;
189 [*] Maintain a devtmpfs filesystem to mount at /dev
190 [ ] Automount devtmpfs at /dev, after the kernel mounted the rootfs
191</pre>
192
193<p>
191Now go to <c>File Systems</c> and select support for the filesystems you use. 194Now go to <c>File Systems</c> and select support for the filesystems you use.
192<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be 195<e>Don't</e> compile the file system you use for the root filesystem as module,
193able to mount your partitions. Also select <c>Virtual memory</c> and <c>/proc 196otherwise your Gentoo system will not be able to mount your partition. Also
194file system</c>. 197select <c>Virtual memory</c> and <c>/proc file system</c>.
195</p> 198</p>
196 199
197<pre caption="Selecting necessary file systems"> 200<pre caption="Selecting necessary file systems">
198File systems ---&gt; 201File systems ---&gt;
202<comment>(Select one or more of the following options as needed by your system)</comment>
203 &lt;*&gt; Second extended fs support
204 &lt;*&gt; Ext3 journalling file system support
205 &lt;*&gt; The Extended 4 (ext4) filesystem
206 &lt;*&gt; Reiserfs support
207 &lt;*&gt; JFS filesystem support
208 &lt;*&gt; XFS filesystem support
209 ...
199 Pseudo Filesystems ---&gt; 210 Pseudo Filesystems ---&gt;
200 [*] /proc file system support 211 [*] /proc file system support
201 [*] Virtual memory file system support (former shm fs) 212 [*] Virtual memory file system support (former shm fs)
202 213
203<comment>(Select one or more of the following options as needed by your system)</comment> 214<comment>(Enable GPT partition label support if you used that previously)</comment>
204 &lt;*&gt; Reiserfs support 215-*- Enable the block layer --->
205 &lt;*&gt; Ext3 journalling file system support 216 ...
206 &lt;*&gt; JFS filesystem support 217 Partition Types --->
207 &lt;*&gt; Second extended fs support 218 [*] Advanced partition selection
208 &lt;*&gt; XFS filesystem support 219 ...
220 [*] EFI GUID Partition support
209</pre> 221</pre>
210 222
211<p> 223<p>
212If you are using PPPoE to connect to the Internet or you are using a dial-up 224If you are using PPPoE to connect to the Internet or you are using a dial-up
213modem, you will need the following options in the kernel: 225modem, you will need the following options in the kernel:
214</p> 226</p>
215 227
216<pre caption="Selecting PPPoE necessary drivers"> 228<pre caption="Selecting PPPoE necessary drivers">
217Device Drivers ---&gt; 229Device Drivers ---&gt;
218 Networking Support ---&gt; 230 Network device support ---&gt;
219 &lt;*&gt; PPP (point-to-point protocol) support 231 &lt;*&gt; PPP (point-to-point protocol) support
220 &lt;*&gt; PPP support for async serial ports 232 &lt;*&gt; PPP support for async serial ports
221 &lt;*&gt; PPP support for sync tty ports 233 &lt;*&gt; PPP support for sync tty ports
222</pre> 234</pre>
223 235
261those as well: 273those as well:
262</p> 274</p>
263 275
264<pre caption="Activating USB Support for Input Devices"> 276<pre caption="Activating USB Support for Input Devices">
265Device Drivers ---&gt; 277Device Drivers ---&gt;
266 USB Support ---&gt; 278 [*] HID Devices ---&gt;
267 &lt;*&gt; USB Human Interface Device (full HID) support 279 &lt;*&gt; USB Human Interface Device (full HID) support
268</pre> 280</pre>
269 281
270</body> 282</body>
271<body test="func:keyval('arch')='x86'"> 283<body test="func:keyval('arch')='x86'">
274If you want PCMCIA support for your laptop, don't forget to enable 286If you want PCMCIA support for your laptop, don't forget to enable
275support for the PCMCIA card bridge present in your system: 287support for the PCMCIA card bridge present in your system:
276</p> 288</p>
277 289
278<pre caption="Enabling PCMCIA support"> 290<pre caption="Enabling PCMCIA support">
279Bus options (PCI, PCMCIA, EISA, MCA, ISA) ---&gt; 291Bus options (PCI etc.) ---&gt;
280 PCCARD (PCMCIA/CardBus) support ---&gt; 292 PCCARD (PCMCIA/CardBus) support ---&gt;
281 &lt;*&gt; PCCard (PCMCIA/CardBus) support 293 &lt;*&gt; PCCard (PCMCIA/CardBus) support
282<comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment> 294<comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment>
283 &lt;*&gt; 16-bit PCMCIA support 295 &lt;*&gt; 16-bit PCMCIA support
284 [*] 32-bit CardBus support 296 [*] 32-bit CardBus support
285<comment>(select the relevant bridges below)</comment> 297<comment>(select the relevant bridges below)</comment>
286 --- PC-card bridges 298 *** PC-card bridges ***
287 &lt;*&gt; CardBus yenta-compatible bridge support (NEW) 299 &lt;*&gt; CardBus yenta-compatible bridge support (NEW)
288 &lt;*&gt; Cirrus PD6729 compatible bridge support (NEW) 300 &lt;*&gt; Cirrus PD6729 compatible bridge support (NEW)
289 &lt;*&gt; i82092 compatible bridge support (NEW) 301 &lt;*&gt; i82092 compatible bridge support (NEW)
290 &lt;*&gt; i82365 compatible bridge support (NEW)
291 &lt;*&gt; Databook TCIC host bridge support (NEW)
292</pre> 302</pre>
293 303
294<p> 304<p>
295When you've finished configuring the kernel, continue with <uri 305When you've finished configuring the kernel, continue with <uri
296link="#compiling">Compiling and Installing</uri>. 306link="#compiling">Compiling and Installing</uri>.
297</p> 307</p>
298 308
299</body> 309</body>
300</subsection> 310</subsection>
301<subsection id="compiling"> 311<subsection id="compiling">
302<title>Compiling and Installing</title> 312<title>Compiling and Installing</title>
303<body> 313<body>
304 314
305<p> 315<p>
306Now that your kernel is configured, it is time to compile and install it. Exit 316Now that your kernel is configured, it is time to compile and install it. Exit
307the configuration and start the compilation process: 317the configuration and start the compilation process:
308</p> 318</p>
309 319
310<pre caption="Compiling the kernel"> 320<pre caption="Compiling the kernel">
311# <i>make &amp;&amp; make modules_install</i> 321# <i>make &amp;&amp; make modules_install</i>
321 331
322<pre caption="Installing the kernel"> 332<pre caption="Installing the kernel">
323# <i>cp arch/<keyval id="arch-sub"/>/boot/bzImage /boot/<keyval id="kernel-name"/></i> 333# <i>cp arch/<keyval id="arch-sub"/>/boot/bzImage /boot/<keyval id="kernel-name"/></i>
324</pre> 334</pre>
325 335
326<p>
327Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
328</p>
329
330</body> 336</body>
337</subsection>
331</subsection> 338<subsection>
339<include href="hb-install-initramfs.xml"/>
340</subsection>
341
332</section> 342</section>
333<section id="genkernel"> 343<section id="genkernel">
334<title>Alternative: Using genkernel</title> 344<title>Alternative: Using genkernel</title>
335<body> 345<body>
336 346
338If you are reading this section, you have chosen to use our <c>genkernel</c> 348If you are reading this section, you have chosen to use our <c>genkernel</c>
339script to configure your kernel for you. 349script to configure your kernel for you.
340</p> 350</p>
341 351
342<p> 352<p>
343Now that your kernel source tree is installed, it's now time to compile your 353Now that your kernel source tree is installed, it's now time to compile your
344kernel by using our <c>genkernel</c> script to automatically build a kernel for 354kernel by using our <c>genkernel</c> script to automatically build a kernel for
345you. <c>genkernel</c> works by configuring a kernel nearly identically to the 355you. <c>genkernel</c> works by configuring a kernel nearly identically to the
346way our Installation CD kernel is configured. This means that when you use 356way our Installation CD kernel is configured. This means that when you use
347<c>genkernel</c> to build your kernel, your system will generally detect all 357<c>genkernel</c> to build your kernel, your system will generally detect all
348your hardware at boot-time, just like our Installation CD does. Because 358your hardware at boot-time, just like our Installation CD does. Because
349genkernel doesn't require any manual kernel configuration, it is an ideal 359genkernel doesn't require any manual kernel configuration, it is an ideal
350solution for those users who may not be comfortable compiling their own kernels. 360solution for those users who may not be comfortable compiling their own kernels.
351</p> 361</p>
352 362
353<p> 363<p>
354Now, let's see how to use genkernel. First, emerge the genkernel ebuild: 364Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
355</p> 365</p>
356 366
357<pre caption="Emerging genkernel"> 367<pre caption="Emerging genkernel">
358# <i>emerge genkernel</i> 368# <i>emerge genkernel</i>
359</pre> 369</pre>
360
361</body>
362<body test="func:keyval('arch')='x86'">
363
364<p>
365Next, copy over the kernel configuration used by the Installation CD to the
366location where genkernel looks for the default kernel configuration:
367</p>
368
369<pre caption="Copying over the Installation CD kernel config">
370# <i>zcat /proc/config.gz &gt; /usr/share/genkernel/x86/kernel-config-2.6</i>
371</pre>
372
373</body>
374<body>
375 370
376<p> 371<p>
377Now, compile your kernel sources by running <c>genkernel all</c>. Be aware 372Now, compile your kernel sources by running <c>genkernel all</c>. Be aware
378though, as <c>genkernel</c> compiles a kernel that supports almost all 373though, as <c>genkernel</c> compiles a kernel that supports almost all
379hardware, this compilation will take quite a while to finish! 374hardware, this compilation will take quite a while to finish!
380</p> 375</p>
381 376
382<p> 377<p>
383Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you 378Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you
384might need to manually configure your kernel using <c>genkernel --menuconfig 379might need to manually configure your kernel using <c>genkernel --menuconfig
385all</c> and add support for your filesystem <e>in</e> the kernel (i.e. 380all</c> and add support for your filesystem <e>in</e> the kernel (i.e.
386<e>not</e> as a module). Users of EVMS2 or LVM2 will probably want to add 381<e>not</e> as a module). Users of LVM2 will probably want to add <c>--lvm</c>
387<c>--evms2</c> or <c>--lvm2</c> as argument as well. 382as an argument as well.
388</p> 383</p>
389 384
390<pre caption="Running genkernel"> 385<pre caption="Running genkernel">
391# <i>genkernel all</i> 386# <i>genkernel all</i>
392</pre> 387</pre>
393 388
394<p> 389<p>
395Once <c>genkernel</c> completes, a kernel, full set of modules and 390Once <c>genkernel</c> completes, a kernel, full set of modules and
396<e>initial root disk</e> (initrd) will be created. We will use the kernel 391<e>initial ram disk</e> (initramfs) will be created. We will use the kernel
397and initrd when configuring a boot loader later in this document. Write 392and initrd when configuring a boot loader later in this document. Write
398down the names of the kernel and initrd as you will need it when writing 393down the names of the kernel and initrd as you will need it when writing
399the bootloader configuration file. The initrd will be started immediately after 394the bootloader configuration file. The initrd will be started immediately after
400booting to perform hardware autodetection (just like on the Installation CD) 395booting to perform hardware autodetection (just like on the Installation CD)
401before your "real" system starts up. 396before your "real" system starts up.
402</p> 397</p>
403 398
404<pre caption="Checking the created kernel image name and initrd"> 399<pre caption="Checking the created kernel image name and initrd">

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.53

  ViewVC Help
Powered by ViewVC 1.1.20