/[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.1 - (hide annotations) (download) (as text)
Wed Aug 2 21:15:02 2006 UTC (7 years, 11 months ago) by neysx
Branch: MAIN
File MIME type: application/xml
Copy of latest x86 files

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

  ViewVC Help
Powered by ViewVC 1.1.20