| … | |
… | |
| 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.37 2011/08/12 19:05:02 swift Exp $ --> |
7 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml,v 1.38 2011/08/22 17:23:47 swift Exp $ --> |
| 8 | |
8 | |
| 9 | <sections> |
9 | <sections> |
| 10 | |
10 | |
| 11 | <abstract> |
11 | <abstract> |
| 12 | The Linux kernel is the core of every distribution. This chapter |
12 | The Linux kernel is the core of every distribution. This chapter |
| … | |
… | |
| 46 | <p> |
46 | <p> |
| 47 | The core around which all distributions are built is the Linux kernel. It is the |
47 | The core around which all distributions are built is the Linux kernel. It is the |
| 48 | layer between the user programs and your system hardware. Gentoo provides its |
48 | layer between the user programs and your system hardware. Gentoo provides its |
| 49 | users several possible kernel sources. A full listing with description is |
49 | users several possible kernel sources. A full listing with description is |
| 50 | available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel |
50 | available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel |
| 51 | Guide</uri>. |
51 | Guide</uri>. |
| 52 | </p> |
52 | </p> |
| 53 | |
53 | |
| 54 | <p> |
54 | <p> |
| 55 | For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c> |
55 | For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c> |
| 56 | (kernel source patched for extra features). |
56 | (kernel source patched for extra features). |
| … | |
… | |
| 83 | the best way to optimize your environment. |
83 | the best way to optimize your environment. |
| 84 | </p> |
84 | </p> |
| 85 | |
85 | |
| 86 | <p> |
86 | <p> |
| 87 | If you want to manually configure your kernel, continue now with <uri |
87 | If you want to manually configure your kernel, continue now with <uri |
| 88 | link="#manual">Default: Manual Configuration</uri>. If you want to use |
88 | link="#manual">Default: Manual Configuration</uri>. If you want to use |
| 89 | <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using |
89 | <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using |
| 90 | genkernel</uri> instead. |
90 | genkernel</uri> instead. |
| 91 | </p> |
91 | </p> |
| 92 | |
92 | |
| 93 | </body> |
93 | </body> |
| 94 | </subsection> |
94 | </subsection> |
| … | |
… | |
| 105 | couple of kernels you don't even remember that it was difficult ;) |
105 | couple of kernels you don't even remember that it was difficult ;) |
| 106 | </p> |
106 | </p> |
| 107 | |
107 | |
| 108 | <p> |
108 | <p> |
| 109 | However, one thing <e>is</e> true: you must know your system when you start |
109 | However, one thing <e>is</e> true: you must know your system when you start |
| 110 | configuring a kernel manually. Most information can be gathered by emerging |
110 | configuring a kernel manually. Most information can be gathered by emerging |
| 111 | pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now |
111 | pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now |
| 112 | be able to use <c>lspci</c> within the chrooted environment. You may safely |
112 | be able to use <c>lspci</c> within the chrooted environment. You may safely |
| 113 | ignore any <e>pcilib</e> warnings (like pcilib: cannot open |
113 | ignore any <e>pcilib</e> warnings (like pcilib: cannot open |
| 114 | /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run |
114 | /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. |
115 | <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same. |
| 116 | You can also run <c>lsmod</c> to see what kernel modules the Installation CD |
116 | You can also run <c>lsmod</c> to see what kernel modules the Installation CD |
| 117 | uses (it might provide you with a nice hint on what to enable). |
117 | uses (it might provide you with a nice hint on what to enable). |
| 118 | </p> |
118 | </p> |
| 119 | |
119 | |
| 120 | <p> |
120 | <p> |
| 121 | Now go to your kernel source directory and execute <c>make menuconfig</c>. This |
121 | Now go to your kernel source directory and execute <c>make menuconfig</c>. This |
| … | |
… | |
| 168 | link="?part=1&chap=10#doc_chap2_sect2">bootloader</uri>. |
168 | link="?part=1&chap=10#doc_chap2_sect2">bootloader</uri>. |
| 169 | </note> |
169 | </note> |
| 170 | |
170 | |
| 171 | <pre caption="Selecting processor type and features"> |
171 | <pre caption="Selecting processor type and features"> |
| 172 | Processor type and features ---> |
172 | Processor type and features ---> |
| 173 | [ ] Machine Check / overheating reporting |
173 | [ ] Machine Check / overheating reporting |
| 174 | [ ] Intel MCE Features |
174 | [ ] Intel MCE Features |
| 175 | [ ] AMD MCE Features |
175 | [ ] AMD MCE Features |
| 176 | Processor family (AMD-Opteron/Athlon64) ---> |
176 | Processor family (AMD-Opteron/Athlon64) ---> |
| 177 | ( ) Opteron/Athlon64/Hammer/K8 |
177 | ( ) Opteron/Athlon64/Hammer/K8 |
| 178 | ( ) Intel P4 / older Netburst based Xeon |
178 | ( ) Intel P4 / older Netburst based Xeon |
| … | |
… | |
| 302 | <*> i82365 compatible bridge support (NEW) |
302 | <*> i82365 compatible bridge support (NEW) |
| 303 | <*> Databook TCIC host bridge support (NEW) |
303 | <*> Databook TCIC host bridge support (NEW) |
| 304 | </pre> |
304 | </pre> |
| 305 | |
305 | |
| 306 | <p> |
306 | <p> |
| 307 | When you've finished configuring the kernel, continue with <uri |
307 | When you've finished configuring the kernel, continue with <uri |
| 308 | link="#compiling">Compiling and Installing</uri>. |
308 | link="#compiling">Compiling and Installing</uri>. |
| 309 | </p> |
309 | </p> |
| 310 | |
310 | |
| 311 | </body> |
311 | </body> |
| 312 | </subsection> |
312 | </subsection> |
| 313 | <subsection id="compiling"> |
313 | <subsection id="compiling"> |
| 314 | <title>Compiling and Installing</title> |
314 | <title>Compiling and Installing</title> |
| 315 | <body> |
315 | <body> |
| 316 | |
316 | |
| 317 | <p> |
317 | <p> |
| 318 | Now that your kernel is configured, it is time to compile and install it. Exit |
318 | Now that your kernel is configured, it is time to compile and install it. Exit |
| 319 | the configuration and start the compilation process: |
319 | the configuration and start the compilation process: |
| 320 | </p> |
320 | </p> |
| 321 | |
321 | |
| 322 | <pre caption="Compiling the kernel"> |
322 | <pre caption="Compiling the kernel"> |
| 323 | # <i>make && make modules_install</i> |
323 | # <i>make && make modules_install</i> |
| … | |
… | |
| 350 | If you are reading this section, you have chosen to use our <c>genkernel</c> |
350 | If you are reading this section, you have chosen to use our <c>genkernel</c> |
| 351 | script to configure your kernel for you. |
351 | script to configure your kernel for you. |
| 352 | </p> |
352 | </p> |
| 353 | |
353 | |
| 354 | <p> |
354 | <p> |
| 355 | Now that your kernel source tree is installed, it's now time to compile your |
355 | Now that your kernel source tree is installed, it's now time to compile your |
| 356 | kernel by using our <c>genkernel</c> script to automatically build a kernel for |
356 | kernel by using our <c>genkernel</c> script to automatically build a kernel for |
| 357 | you. <c>genkernel</c> works by configuring a kernel nearly identically to the |
357 | you. <c>genkernel</c> works by configuring a kernel nearly identically to the |
| 358 | way our Installation CD kernel is configured. This means that when you use |
358 | way our Installation CD kernel is configured. This means that when you use |
| 359 | <c>genkernel</c> to build your kernel, your system will generally detect all |
359 | <c>genkernel</c> to build your kernel, your system will generally detect all |
| 360 | your hardware at boot-time, just like our Installation CD does. Because |
360 | your hardware at boot-time, just like our Installation CD does. Because |
| 361 | genkernel doesn't require any manual kernel configuration, it is an ideal |
361 | genkernel doesn't require any manual kernel configuration, it is an ideal |
| 362 | solution for those users who may not be comfortable compiling their own kernels. |
362 | solution for those users who may not be comfortable compiling their own kernels. |
| 363 | </p> |
363 | </p> |
| 364 | |
364 | |
| 365 | <p> |
365 | <p> |
| 366 | Now, let's see how to use genkernel. First, emerge the genkernel ebuild: |
366 | Now, let's see how to use genkernel. First, emerge the genkernel ebuild: |
| … | |
… | |
| 389 | hardware, this compilation will take quite a while to finish! |
389 | hardware, this compilation will take quite a while to finish! |
| 390 | </p> |
390 | </p> |
| 391 | |
391 | |
| 392 | <p> |
392 | <p> |
| 393 | Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you |
393 | Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you |
| 394 | might need to manually configure your kernel using <c>genkernel --menuconfig |
394 | might need to manually configure your kernel using <c>genkernel --menuconfig |
| 395 | all</c> and add support for your filesystem <e>in</e> the kernel (i.e. |
395 | all</c> and add support for your filesystem <e>in</e> the kernel (i.e. |
| 396 | <e>not</e> as a module). Users of EVMS2 or LVM2 will probably want to add |
396 | <e>not</e> as a module). Users of EVMS2 or LVM2 will probably want to add |
| 397 | <c>--evms2</c> or <c>--lvm2</c> as arguments as well. |
397 | <c>--evms2</c> or <c>--lvm2</c> as arguments as well. |
| 398 | </p> |
398 | </p> |
| 399 | |
399 | |
| 400 | <pre caption="Running genkernel"> |
400 | <pre caption="Running genkernel"> |
| 401 | # <i>genkernel all</i> |
401 | # <i>genkernel all</i> |
| 402 | </pre> |
402 | </pre> |
| 403 | |
403 | |
| 404 | <p> |
404 | <p> |
| 405 | Once <c>genkernel</c> completes, a kernel, full set of modules and |
405 | Once <c>genkernel</c> completes, a kernel, full set of modules and |
| 406 | <e>initial ram disk</e> (initramfs) will be created. We will use the kernel |
406 | <e>initial ram disk</e> (initramfs) will be created. We will use the kernel |
| 407 | and initrd when configuring a boot loader later in this document. Write |
407 | and initrd when configuring a boot loader later in this document. Write |
| 408 | down the names of the kernel and initrd as you will need it when writing |
408 | down the names of the kernel and initrd as you will need it when writing |
| 409 | the bootloader configuration file. The initrd will be started immediately after |
409 | the bootloader configuration file. The initrd will be started immediately after |
| 410 | booting to perform hardware autodetection (just like on the Installation CD) |
410 | booting to perform hardware autodetection (just like on the Installation CD) |
| 411 | before your "real" system starts up. |
411 | before your "real" system starts up. |
| 412 | </p> |
412 | </p> |
| 413 | |
413 | |
| 414 | <pre caption="Checking the created kernel image name and initrd"> |
414 | <pre caption="Checking the created kernel image name and initrd"> |