/[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.4 - (hide annotations) (download) (as text)
Thu Aug 3 14:18:44 2006 UTC (8 years, 3 months ago) by neysx
Branch: MAIN
Changes since 1.3: +7 -3 lines
File MIME type: application/xml
Revert changes

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

  ViewVC Help
Powered by ViewVC 1.1.20