/[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.57
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.57 2014/08/07 16:15:41 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>27</version>
17<date>2008-05-19</date> 17<date>2014-08-07</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
128</pre> 107</pre>
129 108
130<p> 109<p>
131You will be greeted with several configuration sections. We'll first list some 110You will be greeted with several configuration sections. We'll first list some
132options you must activate (otherwise Gentoo will not function, or not function 111options you must activate (otherwise Gentoo will not function, or not function
133properly without additional tweaks). 112properly without additional tweaks). We also have a <uri
113link="https://wiki.gentoo.org/wiki/Kernel/Gentoo_Kernel_Configuration_Guide">Gentoo
114Kernel Configuration Guide</uri> on the Gentoo wiki that might help you further.
134</p> 115</p>
135 116
136</body> 117</body>
137</subsection> 118</subsection>
138<subsection> 119<subsection>
153strongly recommends users enable MCE features so that they are able to be 134strongly 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 135notified 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 136<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 137requires 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 138Emulation 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 139multilib system (mixed 32-bit/64-bit computing) by default, so this option is
159want this option. 140required.
160</p> 141</p>
142
143<note>
144If you plan to use a non-multilib profile (for a pure 64-bit system), then you
145don't have to select IA32 Emulation support. However, you'll also need to follow
146the <uri link="?part=1&amp;chap=6#doc_chap2_sect2">instructions</uri> for
147switching to a <uri link="https://wiki.gentoo.org/wiki/AMD64/FAQ">non-multilib
148profile</uri>, as well as choosing the correct <uri
149link="?part=1&amp;chap=10#doc_chap2_sect2">bootloader</uri>.
150</note>
161 151
162<pre caption="Selecting processor type and features"> 152<pre caption="Selecting processor type and features">
163Processor type and features ---> 153Processor type and features --->
154 [ ] Machine Check / overheating reporting
164 [ ] Intel MCE Features 155 [ ] Intel MCE Features
165 [ ] AMD MCE Features 156 [ ] AMD MCE Features
166 Processor family (AMD-Opteron/Athlon64) ---> 157 Processor family (AMD-Opteron/Athlon64) --->
167 ( ) AMD-Opteron/Athlon64 158 ( ) Opteron/Athlon64/Hammer/K8
159 ( ) Intel P4 / older Netburst based Xeon
160 ( ) Core 2/newer Xeon
168 ( ) Intel EM64T 161 ( ) Intel Atom
169 ( ) Generic-x86-64 162 ( ) Generic-x86-64
170Executable file formats / Emulations ---> 163Executable file formats / Emulations --->
171 [*] IA32 Emulation 164 [*] IA32 Emulation
172</pre> 165</pre>
173 166
186 179
187</body> 180</body>
188<body> 181<body>
189 182
190<p> 183<p>
184Next select <e>Maintain a devtmpfs file system to mount at /dev</e> so that
185critical device files are already available early in the boot process.
186</p>
187
188<pre caption="Enabling devtmpfs support">
189Device Drivers ---&gt;
190 Generic Driver Options ---&gt;
191 [*] Maintain a devtmpfs filesystem to mount at /dev
192 [ ] Automount devtmpfs at /dev, after the kernel mounted the rootfs
193</pre>
194
195<p>
191Now go to <c>File Systems</c> and select support for the filesystems you use. 196Now 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 197<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 198otherwise your Gentoo system will not be able to mount your partition. Also
194file system</c>. 199select <c>Virtual memory</c> and <c>/proc file system</c>.
195</p> 200</p>
196 201
197<pre caption="Selecting necessary file systems"> 202<pre caption="Selecting necessary file systems">
198File systems ---&gt; 203File systems ---&gt;
204<comment>(Select one or more of the following options as needed by your system)</comment>
205 &lt;*&gt; Second extended fs support
206 &lt;*&gt; Ext3 journalling file system support
207 &lt;*&gt; The Extended 4 (ext4) filesystem
208 &lt;*&gt; Reiserfs support
209 &lt;*&gt; JFS filesystem support
210 &lt;*&gt; XFS filesystem support
211 ...
199 Pseudo Filesystems ---&gt; 212 Pseudo Filesystems ---&gt;
200 [*] /proc file system support 213 [*] /proc file system support
201 [*] Virtual memory file system support (former shm fs) 214 [*] Virtual memory file system support (former shm fs)
202 215
203<comment>(Select one or more of the following options as needed by your system)</comment> 216<comment>(Enable GPT partition label support if you used that previously)</comment>
204 &lt;*&gt; Reiserfs support 217-*- Enable the block layer --->
205 &lt;*&gt; Ext3 journalling file system support 218 ...
206 &lt;*&gt; JFS filesystem support 219 Partition Types --->
207 &lt;*&gt; Second extended fs support 220 [*] Advanced partition selection
208 &lt;*&gt; XFS filesystem support 221 ...
222 [*] EFI GUID Partition support
209</pre> 223</pre>
210 224
211<p> 225<p>
212If you are using PPPoE to connect to the Internet or you are using a dial-up 226If 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: 227modem, you will need the following options in the kernel:
214</p> 228</p>
215 229
216<pre caption="Selecting PPPoE necessary drivers"> 230<pre caption="Selecting PPPoE necessary drivers">
217Device Drivers ---&gt; 231Device Drivers ---&gt;
218 Networking Support ---&gt; 232 Network device support ---&gt;
219 &lt;*&gt; PPP (point-to-point protocol) support 233 &lt;*&gt; PPP (point-to-point protocol) support
220 &lt;*&gt; PPP support for async serial ports 234 &lt;*&gt; PPP support for async serial ports
221 &lt;*&gt; PPP support for sync tty ports 235 &lt;*&gt; PPP support for sync tty ports
222</pre> 236</pre>
223 237
261those as well: 275those as well:
262</p> 276</p>
263 277
264<pre caption="Activating USB Support for Input Devices"> 278<pre caption="Activating USB Support for Input Devices">
265Device Drivers ---&gt; 279Device Drivers ---&gt;
266 USB Support ---&gt; 280 [*] HID Devices ---&gt;
267 &lt;*&gt; USB Human Interface Device (full HID) support 281 &lt;*&gt; USB Human Interface Device (full HID) support
268</pre> 282</pre>
269 283
270</body> 284</body>
271<body test="func:keyval('arch')='x86'"> 285<body test="func:keyval('arch')='x86'">
274If you want PCMCIA support for your laptop, don't forget to enable 288If you want PCMCIA support for your laptop, don't forget to enable
275support for the PCMCIA card bridge present in your system: 289support for the PCMCIA card bridge present in your system:
276</p> 290</p>
277 291
278<pre caption="Enabling PCMCIA support"> 292<pre caption="Enabling PCMCIA support">
279Bus options (PCI, PCMCIA, EISA, MCA, ISA) ---&gt; 293Bus options (PCI etc.) ---&gt;
280 PCCARD (PCMCIA/CardBus) support ---&gt; 294 PCCARD (PCMCIA/CardBus) support ---&gt;
281 &lt;*&gt; PCCard (PCMCIA/CardBus) support 295 &lt;*&gt; PCCard (PCMCIA/CardBus) support
282<comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment> 296<comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment>
283 &lt;*&gt; 16-bit PCMCIA support 297 &lt;*&gt; 16-bit PCMCIA support
284 [*] 32-bit CardBus support 298 [*] 32-bit CardBus support
285<comment>(select the relevant bridges below)</comment> 299<comment>(select the relevant bridges below)</comment>
286 --- PC-card bridges 300 *** PC-card bridges ***
287 &lt;*&gt; CardBus yenta-compatible bridge support (NEW) 301 &lt;*&gt; CardBus yenta-compatible bridge support (NEW)
288 &lt;*&gt; Cirrus PD6729 compatible bridge support (NEW) 302 &lt;*&gt; Cirrus PD6729 compatible bridge support (NEW)
289 &lt;*&gt; i82092 compatible bridge support (NEW) 303 &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> 304</pre>
293 305
294<p> 306<p>
295When you've finished configuring the kernel, continue with <uri 307When you've finished configuring the kernel, continue with <uri
296link="#compiling">Compiling and Installing</uri>. 308link="#compiling">Compiling and Installing</uri>.
297</p> 309</p>
298 310
299</body> 311</body>
300</subsection> 312</subsection>
301<subsection id="compiling"> 313<subsection id="compiling">
302<title>Compiling and Installing</title> 314<title>Compiling and Installing</title>
303<body> 315<body>
304 316
305<p> 317<p>
306Now that your kernel is configured, it is time to compile and install it. Exit 318Now that your kernel is configured, it is time to compile and install it. Exit
307the configuration and start the compilation process: 319the configuration and start the compilation process:
308</p> 320</p>
309 321
310<pre caption="Compiling the kernel"> 322<pre caption="Compiling the kernel">
311# <i>make &amp;&amp; make modules_install</i> 323# <i>make &amp;&amp; make modules_install</i>
312</pre> 324</pre>
313 325
314<p> 326<p>
315When the kernel has finished compiling, copy the kernel image to 327When the kernel has finished compiling, copy the kernel image to
316<path>/boot</path>. Use whatever name you feel is appropriate for your kernel 328<path>/boot</path>. This is handled by the <c>make install</c> command:
317choice and remember it as you will need it later on when you configure your
318bootloader. Remember to replace <c><keyval id="kernel-name"/></c> with the
319name and version of your kernel.
320</p> 329</p>
321 330
322<pre caption="Installing the kernel"> 331<pre caption="Installing the kernel">
323# <i>cp arch/<keyval id="arch-sub"/>/boot/bzImage /boot/<keyval id="kernel-name"/></i> 332# <i>make install</i>
324</pre> 333</pre>
325 334
326<p>
327Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
328</p> 335<p>
336This will copy the kernel image into <path>/boot</path> together with the
337<path>System.map</path> file and the kernel configuration file.
338</p>
329 339
330</body> 340</body>
341</subsection>
331</subsection> 342<subsection>
343<include href="hb-install-initramfs.xml"/>
344</subsection>
345
332</section> 346</section>
333<section id="genkernel"> 347<section id="genkernel">
334<title>Alternative: Using genkernel</title> 348<title>Alternative: Using genkernel</title>
335<body> 349<body>
336 350
338If you are reading this section, you have chosen to use our <c>genkernel</c> 352If you are reading this section, you have chosen to use our <c>genkernel</c>
339script to configure your kernel for you. 353script to configure your kernel for you.
340</p> 354</p>
341 355
342<p> 356<p>
343Now that your kernel source tree is installed, it's now time to compile your 357Now 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 358kernel 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 359you. <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 360way 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 361<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 362your hardware at boot-time, just like our Installation CD does. Because
349genkernel doesn't require any manual kernel configuration, it is an ideal 363genkernel doesn't require any manual kernel configuration, it is an ideal
350solution for those users who may not be comfortable compiling their own kernels. 364solution for those users who may not be comfortable compiling their own kernels.
351</p> 365</p>
352 366
353<p> 367<p>
354Now, let's see how to use genkernel. First, emerge the genkernel ebuild: 368Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
356 370
357<pre caption="Emerging genkernel"> 371<pre caption="Emerging genkernel">
358# <i>emerge genkernel</i> 372# <i>emerge genkernel</i>
359</pre> 373</pre>
360 374
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> 375<p>
368 376Next, edit the <path>/etc/fstab</path> file so that the line containing
369<pre caption="Copying over the Installation CD kernel config"> 377<path>/boot</path> as second field has the first field pointing to the right
370# <i>zcat /proc/config.gz &gt; /usr/share/genkernel/x86/kernel-config-2.6</i> 378device. If the partitioning example from the handbook is followed, then this
379device is most likely <path><keyval id="/boot"/></path> with the ext2 file
380system. This would make the entry in the file look like so:
371</pre> 381</p>
372 382
373</body> 383<pre caption="Editing /etc/fstab for the /boot entry">
374<body> 384# <i>nano -w /etc/fstab</i>
385...
386<keyval id="/boot"/> /boot ext2 defaults 0 2
387</pre>
388
389<p>
390The remainder of the <path>/etc/fstab</path> will be updated in the next section,
391but as <c>genkernel</c> reads this information we need to update the
392<path>/boot</path> line up front.
393</p>
375 394
376<p> 395<p>
377Now, compile your kernel sources by running <c>genkernel all</c>. Be aware 396Now, compile your kernel sources by running <c>genkernel all</c>. Be aware
378though, as <c>genkernel</c> compiles a kernel that supports almost all 397though, as <c>genkernel</c> compiles a kernel that supports almost all
379hardware, this compilation will take quite a while to finish! 398hardware, this compilation will take quite a while to finish!
380</p> 399</p>
381 400
382<p> 401<p>
383Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you 402Note 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 403might 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. 404all</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 405<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. 406as an argument as well.
388</p> 407</p>
389 408
390<pre caption="Running genkernel"> 409<pre caption="Running genkernel">
391# <i>genkernel all</i> 410# <i>genkernel all</i>
392</pre> 411</pre>
393 412
394<p> 413<p>
395Once <c>genkernel</c> completes, a kernel, full set of modules and 414Once <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 415<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 416and 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 417down 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 418the bootloader configuration file. The initrd will be started immediately after
400booting to perform hardware autodetection (just like on the Installation CD) 419booting to perform hardware autodetection (just like on the Installation CD)
401before your "real" system starts up. 420before your "real" system starts up.
402</p> 421</p>
403 422
404<pre caption="Checking the created kernel image name and initrd"> 423<pre caption="Checking the created kernel image name and initrd">

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

  ViewVC Help
Powered by ViewVC 1.1.20