/[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.12 - (hide annotations) (download) (as text)
Sun May 20 04:16:25 2007 UTC (7 years, 1 month ago) by nightmorph
Branch: MAIN
Changes since 1.11: +14 -3 lines
File MIME type: application/xml
for safety's sake, needed to move the conf.d/clock TIMEZONE edit to immediately before compiling a kernel. users still run into the warning message if it's left at the end, before rebooting. fixes http://forums.gentoo.org/viewtopic-t-560322.html and other reports.

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

  ViewVC Help
Powered by ViewVC 1.1.20