/[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.3 - (show annotations) (download) (as text)
Thu Aug 3 12:49:33 2006 UTC (8 years, 4 months ago) by rane
Branch: MAIN
Changes since 1.2: +3 -7 lines
File MIME type: application/xml
removing a useless link leading to a section just below it

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.2 2006/08/02 21:15:52 neysx Exp $ -->
8
9 <sections>
10
11 <version>3.15</version>
12 <date>2006-08-02</date>
13
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 <p test="func:keyval('arch')='x86'">
49 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 <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 <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 kernel source points to <c>gentoo-sources-<keyval id="kernel-version"/></c>.
77 Your version may be different, so keep this in mind.
78 </p>
79
80 <pre caption="Viewing the kernel source symlink">
81 # <i>ls -l /usr/src/linux</i>
82 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
83 </pre>
84
85 <p>
86 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 </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 <pre caption="Selecting experimental code/drivers">
154 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 </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 <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 </body>
199 <body>
200
201 <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 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 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 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 </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 </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 <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 <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 <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 <p test="func:keyval('arch')='x86'">
325 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 <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 <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 Device Drivers ---&gt;
350 USB Support ---&gt;
351 &lt;*&gt; USB Human Interface Device (full HID) support
352 </pre>
353
354 </body>
355 <body test="func:keyval('arch')='x86'">
356
357 <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 <pre caption="Compiling the kernel" test="func:keyval('arch')='x86'">
402 <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 <pre caption="Compiling the kernel" test="func:keyval('arch')='AMD64'">
410 # <i>make &amp;&amp; make modules_install</i>
411 </pre>
412
413 <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 bootloader. Remember to replace <c><keyval id="kernel-name"/></c> with the
418 name and version of your kernel.
419 </p>
420
421 <pre caption="Installing the kernel">
422 # <i>cp arch/<keyval id="arch-sub"/>/boot/bzImage /boot/<keyval id="kernel-name"/></i>
423 </pre>
424
425 </body>
426 </subsection>
427 </section>
428 <section id="genkernel">
429 <title>Alternative: Using genkernel</title>
430 <body>
431
432 <p>
433 If you are reading this section, you have chosen to use our <c>genkernel</c>
434 script to configure your kernel for you.
435 </p>
436
437 <p>
438 Now that your kernel source tree is installed, it's now time to compile your
439 kernel by using our <c>genkernel</c> script to automatically build a kernel for
440 you. <c>genkernel</c> works by configuring a kernel nearly identically to the
441 way our Installation CD kernel is configured. This means that when you use
442 <c>genkernel</c> to build your kernel, your system will generally detect all
443 your hardware at boot-time, just like our Installation CD does. Because
444 genkernel doesn't require any manual kernel configuration, it is an ideal
445 solution for those users who may not be comfortable compiling their own kernels.
446 </p>
447
448 <p>
449 Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
450 </p>
451
452 <pre caption="Emerging genkernel">
453 # <i>emerge genkernel</i>
454 </pre>
455
456 </body>
457 <body test="func:keyval('arch')='x86'">
458
459 <p>
460 Next, if you are going to configure a 2.6 kernel, copy over the kernel
461 configuration used by the Installation CD to the location where genkernel
462 looks for the default kernel configuration:
463 </p>
464
465 <pre caption="Copying over the Installation CD kernel config">
466 <comment>(Only do this if you are going to configure a 2.6 kernel)</comment>
467 # <i>zcat /proc/config.gz &gt; /usr/share/genkernel/x86/kernel-config-2.6</i>
468 </pre>
469
470 </body>
471 <body>
472
473 <p>
474 Now, compile your kernel sources by running <c>genkernel all</c>. Be aware
475 though, as <c>genkernel</c> compiles a kernel that supports almost all
476 hardware, this compilation will take quite a while to finish!
477 </p>
478
479 <p>
480 Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you
481 might need to manually configure your kernel using <c>genkernel --menuconfig
482 all</c> and add support for your filesystem <e>in</e> the kernel (i.e.
483 <e>not</e> as a module). Users of EVMS2 or LVM2 will probably want to add
484 <c>--evms2</c> or <c>--lvm2</c> as argument as well.
485 </p>
486
487 <pre caption="Running genkernel">
488 # <i>genkernel all</i>
489 </pre>
490
491 <p>
492 Once <c>genkernel</c> completes, a kernel, full set of modules and
493 <e>initial root disk</e> (initrd) will be created. We will use the kernel
494 and initrd when configuring a boot loader later in this document. Write
495 down the names of the kernel and initrd as you will need it when writing
496 the bootloader configuration file. The initrd will be started immediately after
497 booting to perform hardware autodetection (just like on the Installation CD)
498 before your "real" system starts up.
499 </p>
500
501 <pre caption="Checking the created kernel image name and initrd">
502 # <i>ls /boot/kernel* /boot/initramfs*</i>
503 </pre>
504
505 <p>
506 Now, let's perform one more step to get our system to be more like the
507 Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects
508 hardware that is needed to boot your system, <c>coldplug</c> autodetects
509 everything else. To emerge and enable <c>coldplug</c>, type the following:
510 </p>
511
512 <pre caption="Emerging and enabling coldplug">
513 # <i>emerge coldplug</i>
514 # <i>rc-update add coldplug boot</i>
515 </pre>
516
517 </body>
518 </section>
519 <section id="kernel_modules">
520 <title>Kernel Modules</title>
521 <subsection>
522 <title>Configuring the Modules</title>
523 <body>
524
525 <note test="func:keyval('arch')='x86'">
526 If you chose a kernel 2.4, replace occurrences of <c>2.6</c> with <c>2.4</c> in
527 this section.
528 </note>
529
530 <p>
531 You should list the modules you want automatically loaded in
532 <path>/etc/modules.autoload.d/kernel-2.6</path>. You can add extra options to
533 the modules too if you want.
534 </p>
535
536 <p>
537 To view all available modules, run the following <c>find</c> command. Don't
538 forget to substitute <c><keyval id="kernel-version"/></c> with the version of
539 the kernel you just compiled:
540 </p>
541
542 <pre caption="Viewing all available modules">
543 # <i>find /lib/modules/<keyval id="kernel-version"/>/ -type f -iname '*.o' -or -iname '*.ko'</i>
544 </pre>
545
546 <p>
547 For instance, to automatically load the <c>3c59x.o</c> module, edit the
548 <path>kernel-2.6</path> file and enter the module name in it.
549 </p>
550
551 <pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
552 # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
553 </pre>
554
555 <pre caption="/etc/modules.autoload.d/kernel-2.6">
556 3c59x
557 </pre>
558
559 <p>
560 Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
561 your System</uri>.
562 </p>
563
564 </body>
565 </subsection>
566 </section>
567 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20