/[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.6 - (show annotations) (download) (as text)
Sat Oct 28 09:17:55 2006 UTC (7 years, 10 months ago) by neysx
Branch: MAIN
Changes since 1.5: +6 -1 lines
File MIME type: application/xml
Moved chapter abstracts into shared chapters
No content change, hence no bump

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