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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (hide annotations) (download) (as text)
Mon Feb 26 08:54:53 2007 UTC (7 years, 1 month ago) by nightmorph
Branch: MAIN
Changes since 1.7: +7 -13 lines
File MIME type: application/xml
removed USE=symlink by request of dsd as part of the USE flag removal from all kernel sources, bug 167703. also further vanilla-sources removals as it's unsupported.

1 neysx 1.1 <?xml version='1.0' encoding='UTF-8'?>
2     <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3    
4     <!-- The content of this document is licensed under the CC-BY-SA license -->
5     <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6    
7 nightmorph 1.8 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-kernel.xml,v 1.7 2006/12/06 19:59:09 nightmorph Exp $ -->
8 neysx 1.1
9     <sections>
10    
11 neysx 1.6 <abstract>
12     The Linux kernel is the core of every distribution. This chapter
13     explains how to configure your kernel.
14     </abstract>
15    
16 nightmorph 1.8 <version>4.2</version>
17     <date>2007-02-26</date>
18 neysx 1.1
19     <section>
20     <title>Timezone</title>
21     <body>
22    
23     <p>
24     You first need to select your timezone so that your system knows where it is
25     located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy
26     it to <path>/etc/localtime</path>. Please avoid the
27     <path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
28     indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8.
29     </p>
30    
31     <pre caption="Setting the timezone information">
32     # <i>ls /usr/share/zoneinfo</i>
33     <comment>(Suppose you want to use GMT)</comment>
34     # <i>cp /usr/share/zoneinfo/GMT /etc/localtime</i>
35     </pre>
36    
37     </body>
38     </section>
39     <section>
40     <title>Installing the Sources</title>
41     <subsection>
42     <title>Choosing a Kernel</title>
43     <body>
44    
45     <p>
46     The core around which all distributions are built is the Linux kernel. It is the
47     layer between the user programs and your system hardware. Gentoo provides its
48     users several possible kernel sources. A full listing with description is
49     available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
50     Guide</uri>.
51     </p>
52    
53 neysx 1.2 <p test="func:keyval('arch')='x86'">
54 nightmorph 1.8 For x86-based systems we have, amongst other kernels, <c>gentoo-sources</c>
55     (kernel source patched with performance-enhancing features).
56 neysx 1.1 </p>
57    
58 neysx 1.2 <p test="func:keyval('arch')='AMD64'">
59     For AMD64-based systems we have <c>gentoo-sources</c> (kernel v2.6 source
60     patched with amd64 specific fixes for stability, performance and hardware
61     support).
62     </p>
63    
64 neysx 1.1 <p>
65 nightmorph 1.8 Choose your kernel source and install it using <c>emerge</c>.
66 neysx 1.1 </p>
67    
68     <pre caption="Installing a kernel source">
69 nightmorph 1.8 # <i>emerge gentoo-sources</i>
70 neysx 1.1 </pre>
71    
72     <p>
73     When you take a look in <path>/usr/src</path> you should see a symlink called
74     <path>linux</path> pointing to your kernel source. In this case, the installed
75 neysx 1.2 kernel source points to <c>gentoo-sources-<keyval id="kernel-version"/></c>.
76     Your version may be different, so keep this in mind.
77 neysx 1.1 </p>
78    
79     <pre caption="Viewing the kernel source symlink">
80     # <i>ls -l /usr/src/linux</i>
81 neysx 1.2 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
82 neysx 1.1 </pre>
83    
84     <p>
85 neysx 1.2 Now it is time to configure and compile your kernel source. You can use
86     <c>genkernel</c> for this, which will build a generic kernel as used by the
87     Installation CD. We explain the "manual" configuration first though, as it is
88     the best way to optimize your environment.
89 neysx 1.1 </p>
90    
91     <p>
92     If you want to manually configure your kernel, continue now with <uri
93     link="#manual">Default: Manual Configuration</uri>. If you want to use
94     <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
95     genkernel</uri> instead.
96     </p>
97    
98     </body>
99     </subsection>
100     </section>
101     <section id="manual">
102     <title>Default: Manual Configuration</title>
103     <subsection>
104     <title>Introduction</title>
105     <body>
106    
107     <p>
108     Manually configuring a kernel is often seen as the most difficult procedure a
109     Linux user ever has to perform. Nothing is less true -- after configuring a
110     couple of kernels you don't even remember that it was difficult ;)
111     </p>
112    
113     <p>
114     However, one thing <e>is</e> true: you must know your system when you start
115     configuring a kernel manually. Most information can be gathered by emerging
116     pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
117     be able to use <c>lspci</c> within the chrooted environment. You may safely
118     ignore any <e>pcilib</e> warnings (like pcilib: cannot open
119     /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
120     <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
121     You can also run <c>lsmod</c> to see what kernel modules the Installation CD
122     uses (it might provide you with a nice hint on what to enable).
123     </p>
124    
125     <p>
126     Now go to your kernel source directory and execute <c>make menuconfig</c>. This
127     will fire up an ncurses-based configuration menu.
128     </p>
129    
130     <pre caption="Invoking menuconfig">
131     # <i>cd /usr/src/linux</i>
132     # <i>make menuconfig</i>
133     </pre>
134    
135     <p>
136     You will be greeted with several configuration sections. We'll first list some
137     options you must activate (otherwise Gentoo will not function, or not function
138     properly without additional tweaks).
139     </p>
140    
141     </body>
142     </subsection>
143     <subsection>
144     <title>Activating Required Options</title>
145     <body>
146    
147     <p>
148     First of all, activate the use of development and experimental code/drivers.
149     You need this, otherwise some very important code/drivers won't show up:
150     </p>
151    
152 neysx 1.2 <pre caption="Selecting experimental code/drivers">
153 neysx 1.1 Code maturity level options ---&gt;
154     [*] Prompt for development and/or incomplete code/drivers
155     </pre>
156    
157     <p>
158     Make sure that every driver that is vital to the booting of your system (such as
159     SCSI controller, ...) is compiled <e>in</e> the kernel and not as a module,
160     otherwise your system will not be able to boot completely.
161     </p>
162    
163 neysx 1.2 </body>
164     <body test="func:keyval('arch')='AMD64'">
165    
166     <p>
167     We shall then select the exact processor type. The x86_64 kernel maintainer
168     strongly recommends users enable MCE features so that they are able to be
169     notified of any hardware problems. On x86_64, these errors are not printed to
170     <c>dmesg</c> like on other architectures, but to <path>/dev/mcelog</path>. This
171     requires the <c>app-admin/mcelog</c> package.
172     </p>
173    
174     <pre caption="Selecting processor type and features">
175     Processor type and features --->
176     [ ] Intel MCE Features
177     [ ] AMD MCE Features
178     Processor family (AMD-Opteron/Athlon64) --->
179     ( ) AMD-Opteron/Athlon64
180     ( ) Intel EM64T
181     ( ) Generic-x86-64
182     </pre>
183    
184     </body>
185     <body test="func:keyval('arch')='x86'">
186    
187 neysx 1.1 <p>
188     Now select the correct processor family:
189     </p>
190    
191     <pre caption="Selecting correct processor family">
192     Processor type and features ---&gt;
193     <comment>(Change according to your system)</comment>
194     (<i>Athlon/Duron/K7</i>) Processor family
195     </pre>
196    
197 neysx 1.2 </body>
198     <body>
199    
200 neysx 1.1 <p>
201     Now go to <c>File Systems</c> and select support for the filesystems you use.
202     <e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
203     able to mount your partitions. Also select <c>Virtual memory</c> and <c>/proc
204 neysx 1.2 file system</c>.
205     </p>
206    
207     </body>
208     <body test="func:keyval('arch')='x86'">
209    
210     <p>
211     If you are using a 2.4 kernel, you need to select <c>/dev file
212 neysx 1.1 system</c> as 2.4 kernels do not support <c>udev</c>.
213     </p>
214    
215     <pre caption="Selecting necessary file systems">
216     <comment>(With a 2.4.x kernel)</comment>
217     File systems ---&gt;
218     [*] Virtual memory file system support (former shm fs)
219     [*] /proc file system support
220     [*] /dev file system support (EXPERIMENTAL)
221     [*] automatically mount /dev at boot
222     [ ] /dev/pts file system for Unix98 PTYs
223    
224     <comment>(With a 2.6.x kernel)</comment>
225     File systems ---&gt;
226     Pseudo Filesystems ---&gt;
227     [*] /proc file system support
228     [*] Virtual memory file system support (former shm fs)
229    
230     <comment>(Select one or more of the following options as needed by your system)</comment>
231     &lt;*&gt; Reiserfs support
232     &lt;*&gt; Ext3 journalling file system support
233     &lt;*&gt; JFS filesystem support
234     &lt;*&gt; Second extended fs support
235     &lt;*&gt; XFS filesystem support
236     </pre>
237    
238     <p>
239 neysx 1.2 If your BIOS can't handle large hard drives and you jumpered the hard drive to
240     report a limited size you have to enable the following option to gain access to
241     your whole hard drive:
242 neysx 1.1 </p>
243    
244     <pre caption="Selecting autogeometry resizing support">
245     <comment>(2.4.x kernel only)</comment>
246     ATA/IDE/MFM/RLL support ---&gt;
247     IDE, ATA and ATAPI Block devices ---&gt;
248     &lt;*&gt; Include IDE/ATA-2 DISK support
249     [ ] Use multi-mode by default
250     [*] Auto-Geometry Resizing support
251     </pre>
252    
253 neysx 1.2 </body>
254     <body test="func:keyval('arch')='AMD64'">
255    
256     <pre caption="Selecting necessary file systems">
257     File systems ---&gt;
258     Pseudo Filesystems ---&gt;
259     [*] /proc file system support
260     [*] Virtual memory file system support (former shm fs)
261    
262     <comment>(Select one or more of the following options as needed by your system)</comment>
263     &lt;*&gt; Reiserfs support
264     &lt;*&gt; Ext3 journalling file system support
265     &lt;*&gt; JFS filesystem support
266     &lt;*&gt; Second extended fs support
267     &lt;*&gt; XFS filesystem support
268     </pre>
269    
270     </body>
271     <body>
272    
273 neysx 1.1 <p>
274     Do not forget to enable DMA for your drives:
275     </p>
276    
277     <pre caption="Activating DMA">
278     Device Drivers ---&gt;
279     ATA/ATAPI/MFM/RLL support ---&gt;
280     [*] Generic PCI bus-master DMA support
281     [*] Use PCI DMA by default when available
282     </pre>
283    
284     <p>
285     If you are using PPPoE to connect to the Internet or you are using a dial-up
286     modem, you will need the following options in the kernel:
287     </p>
288    
289 neysx 1.2 <pre caption="Selecting PPPoE necessary drivers" test="func:keyval('arch')='AMD64'">
290     Device Drivers ---&gt;
291     Networking Support ---&gt;
292     &lt;*&gt; PPP (point-to-point protocol) support
293     &lt;*&gt; PPP support for async serial ports
294     &lt;*&gt; PPP support for sync tty ports
295     </pre>
296    
297     <pre caption="Selecting PPPoE necessary drivers" test="func:keyval('arch')='x86'">
298 neysx 1.1 <comment>(With a 2.4.x kernel)</comment>
299     Network device support ---&gt;
300     &lt;*&gt; PPP (point-to-point protocol) support
301     &lt;*&gt; PPP support for async serial ports
302     &lt;*&gt; PPP support for sync tty ports
303    
304     <comment>(With a 2.6.x kernel)</comment>
305     Device Drivers ---&gt;
306     Networking support ---&gt;
307     &lt;*&gt; PPP (point-to-point protocol) support
308     &lt;*&gt; PPP support for async serial ports
309     &lt;*&gt; PPP support for sync tty ports
310     </pre>
311    
312     <p>
313     The two compression options won't harm but are not definitely needed, neither
314     does the <c>PPP over Ethernet</c> option, that might only be used by
315     <c>rp-pppoe</c> when configured to do kernel mode PPPoE.
316     </p>
317    
318     <p>
319     If you require it, don't forget to include support in the kernel for your
320     ethernet card.
321     </p>
322    
323 neysx 1.2 <p test="func:keyval('arch')='x86'">
324 neysx 1.1 If you have an Intel CPU that supports HyperThreading (tm), or you have a
325     multi-CPU system, you should activate "Symmetric multi-processing support":
326     </p>
327    
328 neysx 1.2 <p test="func:keyval('arch')='AMD64'">
329     If you have a multi-CPU Opteron or a multi-core (e.g. AMD64 X2) system, you
330     should activate "Symmetric multi-processing support":
331     </p>
332    
333 neysx 1.1 <pre caption="Activating SMP support">
334     Processor type and features ---&gt;
335     [*] Symmetric multi-processing support
336     </pre>
337    
338     <note>
339     In multi-core systems, each core counts as one processor.
340     </note>
341    
342     <p>
343     If you use USB Input Devices (like Keyboard or Mouse) don't forget to enable
344     those as well:
345     </p>
346    
347     <pre caption="Activating USB Support for Input Devices">
348 neysx 1.2 Device Drivers ---&gt;
349     USB Support ---&gt;
350     &lt;*&gt; USB Human Interface Device (full HID) support
351 neysx 1.1 </pre>
352    
353 neysx 1.2 </body>
354     <body test="func:keyval('arch')='x86'">
355    
356 neysx 1.1 <p>
357     Laptop-users who want PCMCIA support should <e>not</e> use the PCMCIA drivers if
358     they choose to use a 2.4 kernel. More recent drivers are available through the
359     <c>pcmcia-cs</c> package which will be installed later on. 2.6-kernel users
360     however should use the PCMCIA drivers from the kernel.
361     </p>
362    
363     <p>
364     Besides compiling in PCMCIA support in the 2.6 kernel, don't forget to enable
365     support for the PCMCIA card bridge present in your system:
366     </p>
367    
368     <pre caption="Enabling PCMCIA support for 2.6 kernels">
369     Bus options (PCI, PCMCIA, EISA, MCA, ISA) ---&gt;
370     PCCARD (PCMCIA/CardBus) support ---&gt;
371     &lt;*&gt; PCCard (PCMCIA/CardBus) support
372     <comment>(select 16 bit if you need support for older PCMCIA cards. Most people want this.)</comment>
373     &lt;*&gt; 16-bit PCMCIA support
374     [*] 32-bit CardBus support
375     <comment>(select the relevant bridges below)</comment>
376     --- PC-card bridges
377     &lt;*&gt; CardBus yenta-compatible bridge support (NEW)
378     &lt;*&gt; Cirrus PD6729 compatible bridge support (NEW)
379     &lt;*&gt; i82092 compatible bridge support (NEW)
380     &lt;*&gt; i82365 compatible bridge support (NEW)
381     &lt;*&gt; Databook TCIC host bridge support (NEW)
382     </pre>
383    
384     <p>
385     When you've finished configuring the kernel, continue with <uri
386     link="#compiling">Compiling and Installing</uri>.
387     </p>
388    
389     </body>
390     </subsection>
391     <subsection id="compiling">
392     <title>Compiling and Installing</title>
393     <body>
394    
395     <p>
396     Now that your kernel is configured, it is time to compile and install it. Exit
397     the configuration and start the compilation process:
398     </p>
399    
400 neysx 1.2 <pre caption="Compiling the kernel" test="func:keyval('arch')='x86'">
401 neysx 1.1 <comment>(For 2.4 kernel)</comment>
402     # <i>make dep &amp;&amp; make bzImage modules modules_install</i>
403    
404     <comment>(For 2.6 kernel)</comment>
405     # <i>make &amp;&amp; make modules_install</i>
406     </pre>
407    
408 neysx 1.2 <pre caption="Compiling the kernel" test="func:keyval('arch')='AMD64'">
409     # <i>make &amp;&amp; make modules_install</i>
410     </pre>
411    
412 neysx 1.1 <p>
413     When the kernel has finished compiling, copy the kernel image to
414     <path>/boot</path>. Use whatever name you feel is appropriate for your kernel
415     choice and remember it as you will need it later on when you configure your
416 neysx 1.2 bootloader. Remember to replace <c><keyval id="kernel-name"/></c> with the
417     name and version of your kernel.
418 neysx 1.1 </p>
419    
420     <pre caption="Installing the kernel">
421 neysx 1.2 # <i>cp arch/<keyval id="arch-sub"/>/boot/bzImage /boot/<keyval id="kernel-name"/></i>
422 neysx 1.1 </pre>
423    
424 neysx 1.4 <p>
425     Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
426     </p>
427    
428 neysx 1.1 </body>
429     </subsection>
430     </section>
431     <section id="genkernel">
432     <title>Alternative: Using genkernel</title>
433     <body>
434    
435     <p>
436     If you are reading this section, you have chosen to use our <c>genkernel</c>
437     script to configure your kernel for you.
438     </p>
439    
440     <p>
441     Now that your kernel source tree is installed, it's now time to compile your
442     kernel by using our <c>genkernel</c> script to automatically build a kernel for
443     you. <c>genkernel</c> works by configuring a kernel nearly identically to the
444     way our Installation CD kernel is configured. This means that when you use
445     <c>genkernel</c> to build your kernel, your system will generally detect all
446     your hardware at boot-time, just like our Installation CD does. Because
447     genkernel doesn't require any manual kernel configuration, it is an ideal
448     solution for those users who may not be comfortable compiling their own kernels.
449     </p>
450    
451     <p>
452     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
453     </p>
454    
455     <pre caption="Emerging genkernel">
456     # <i>emerge genkernel</i>
457     </pre>
458    
459 neysx 1.2 </body>
460     <body test="func:keyval('arch')='x86'">
461    
462 neysx 1.1 <p>
463     Next, if you are going to configure a 2.6 kernel, copy over the kernel
464     configuration used by the Installation CD to the location where genkernel
465     looks for the default kernel configuration:
466     </p>
467    
468     <pre caption="Copying over the Installation CD kernel config">
469     <comment>(Only do this if you are going to configure a 2.6 kernel)</comment>
470     # <i>zcat /proc/config.gz &gt; /usr/share/genkernel/x86/kernel-config-2.6</i>
471     </pre>
472    
473 neysx 1.2 </body>
474     <body>
475    
476 neysx 1.1 <p>
477     Now, compile your kernel sources by running <c>genkernel all</c>. Be aware
478     though, as <c>genkernel</c> compiles a kernel that supports almost all
479     hardware, this compilation will take quite a while to finish!
480     </p>
481    
482     <p>
483     Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you
484     might need to manually configure your kernel using <c>genkernel --menuconfig
485     all</c> and add support for your filesystem <e>in</e> the kernel (i.e.
486     <e>not</e> as a module). Users of EVMS2 or LVM2 will probably want to add
487     <c>--evms2</c> or <c>--lvm2</c> as argument as well.
488     </p>
489    
490     <pre caption="Running genkernel">
491     # <i>genkernel all</i>
492     </pre>
493    
494     <p>
495     Once <c>genkernel</c> completes, a kernel, full set of modules and
496     <e>initial root disk</e> (initrd) will be created. We will use the kernel
497     and initrd when configuring a boot loader later in this document. Write
498     down the names of the kernel and initrd as you will need it when writing
499     the bootloader configuration file. The initrd will be started immediately after
500     booting to perform hardware autodetection (just like on the Installation CD)
501     before your "real" system starts up.
502     </p>
503    
504     <pre caption="Checking the created kernel image name and initrd">
505     # <i>ls /boot/kernel* /boot/initramfs*</i>
506     </pre>
507    
508     <p>
509     Now, let's perform one more step to get our system to be more like the
510     Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects
511     hardware that is needed to boot your system, <c>coldplug</c> autodetects
512     everything else. To emerge and enable <c>coldplug</c>, type the following:
513     </p>
514    
515     <pre caption="Emerging and enabling coldplug">
516     # <i>emerge coldplug</i>
517     # <i>rc-update add coldplug boot</i>
518     </pre>
519    
520 nightmorph 1.7 <note>
521     You no longer need to emerge <c>coldplug</c> if you're using <c>udev</c> version
522     103 and higher. If you receive a message that <c>udev</c> blocks <c>coldplug</c>
523     from being installed, then you don't need to install <c>coldplug</c>.
524     </note>
525    
526 neysx 1.1 </body>
527     </section>
528     <section id="kernel_modules">
529     <title>Kernel Modules</title>
530     <subsection>
531     <title>Configuring the Modules</title>
532     <body>
533    
534 neysx 1.2 <note test="func:keyval('arch')='x86'">
535     If you chose a kernel 2.4, replace occurrences of <c>2.6</c> with <c>2.4</c> in
536     this section.
537     </note>
538    
539 neysx 1.1 <p>
540 neysx 1.2 You should list the modules you want automatically loaded in
541     <path>/etc/modules.autoload.d/kernel-2.6</path>. You can add extra options to
542     the modules too if you want.
543 neysx 1.1 </p>
544    
545     <p>
546     To view all available modules, run the following <c>find</c> command. Don't
547 neysx 1.2 forget to substitute <c><keyval id="kernel-version"/></c> with the version of
548     the kernel you just compiled:
549 neysx 1.1 </p>
550    
551     <pre caption="Viewing all available modules">
552 neysx 1.2 # <i>find /lib/modules/<keyval id="kernel-version"/>/ -type f -iname '*.o' -or -iname '*.ko'</i>
553 neysx 1.1 </pre>
554    
555     <p>
556     For instance, to automatically load the <c>3c59x.o</c> module, edit the
557 neysx 1.2 <path>kernel-2.6</path> file and enter the module name in it.
558 neysx 1.1 </p>
559    
560 neysx 1.2 <pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
561     # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
562 neysx 1.1 </pre>
563    
564 neysx 1.2 <pre caption="/etc/modules.autoload.d/kernel-2.6">
565 neysx 1.1 3c59x
566     </pre>
567    
568     <p>
569     Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
570     your System</uri>.
571     </p>
572    
573     </body>
574     </subsection>
575     </section>
576     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20