/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-alpha-kernel.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-install-alpha-kernel.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.27 - (hide annotations) (download) (as text)
Sat Jul 2 13:04:59 2005 UTC (9 years, 3 months ago) by swift
Branch: MAIN
Changes since 1.26: +5 -6 lines
File MIME type: application/xml
#97662 - Adding hotplug to boot runlevel is not needed anymore

1 swift 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/1.0 -->
6    
7 swift 1.27 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-alpha-kernel.xml,v 1.26 2005/06/09 12:22:26 fox2mike Exp $ -->
8 swift 1.1
9     <sections>
10 swift 1.11
11 swift 1.27 <version>2.5</version>
12     <date>2005-07-02</date>
13 swift 1.11
14 swift 1.1 <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 make a
21     symlink to <path>/etc/localtime</path> using <c>ln</c>:
22     </p>
23    
24     <pre caption="Setting the timezone information">
25     # <i>ls /usr/share/zoneinfo</i>
26     <comment>(Suppose you want to use GMT)</comment>
27     # <i>ln -sf /usr/share/zoneinfo/GMT /etc/localtime</i>
28     </pre>
29    
30     </body>
31     </section>
32     <section>
33     <title>Installing the Sources</title>
34     <subsection>
35     <title>Choosing a Kernel</title>
36     <body>
37    
38     <p>
39     The core around which all distributions are built is the Linux kernel. It is the
40     layer between the user programs and your system hardware. Gentoo provides its
41     users several possible kernel sources. A full listing with description is
42     available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
43     Guide</uri>.
44     </p>
45    
46     <p>
47 swift 1.21 For alpha-based systems we have <c>vanilla-sources</c> (the default 2.6 kernel source).
48 swift 1.1 </p>
49    
50     <p>
51     Choose your kernel source and install it using <c>emerge</c>.
52     </p>
53    
54     <p>
55     In the next example we install the <c>vanilla-sources</c>.
56     Of course substitute with your choice of sources, this is merely an example:
57     </p>
58    
59     <pre caption="Installing a kernel source">
60     # <i>emerge vanilla-sources</i>
61     </pre>
62    
63     <p>
64     When you take a look in <path>/usr/src</path> you should see a symlink called
65     <path>linux</path> pointing to your kernel source:
66     </p>
67    
68     <pre caption="Viewing the kernel source symlink">
69     # <i>ls -l /usr/src/linux</i>
70 swift 1.21 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-2.6.11.2
71 swift 1.1 </pre>
72    
73     <p>
74     If this isn't the case (i.e. the symlink points to a different kernel source)
75     change the symlink before you continue:
76     </p>
77    
78     <pre caption="Changing the kernel source symlink">
79 swift 1.3 # <i>rm /usr/src/linux</i>
80     # <i>cd /usr/src</i>
81 swift 1.21 # <i>ln -s linux-2.6.11.2 linux</i>
82 swift 1.1 </pre>
83    
84     <p>
85     Now it is time to configure and compile your kernel source. You
86     can use <c>genkernel</c> for this, which will build a generic kernel as used
87 swift 1.21 by the Installation CD. We explain the "manual" configuration first though, as it is
88 swift 1.1 the best way to optimize your environment.
89     </p>
90    
91     <p>
92     If you want to manually configure your kernel, continue now with <uri
93     link="#manual">Default: Manual Configuration</uri>. If you want to use
94     <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
95     genkernel</uri> instead.
96     </p>
97    
98     </body>
99     </subsection>
100     </section>
101     <section id="manual">
102     <title>Default: Manual Configuration</title>
103     <subsection>
104     <title>Introduction</title>
105     <body>
106    
107     <p>
108 neysx 1.7 Manually configuring a kernel is often seen as the most difficult procedure a
109 neysx 1.8 Linux user ever has to perform. Nothing is less true -- after configuring a
110 swift 1.1 couple of kernels you don't even remember that it was difficult ;)
111     </p>
112    
113     <p>
114     However, one thing <e>is</e> true: you must know your system when you start
115 swift 1.24 configuring a kernel manually. Most information can be gathered by emerging
116 swift 1.25 pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
117 swift 1.24 be able to use <c>lspci</c> within the chrooted environment. You may safely
118     ignore any <e>pcilib</e> warnings (like pcilib: cannot open
119     /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
120 swift 1.25 <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
121 swift 1.24 You can also run <c>lsmod</c> to see what kernel modules the Installation CD
122     uses (it might provide you with a nice hint on what to enable).
123 swift 1.1 </p>
124    
125     <p>
126     Now go to your kernel source directory and execute <c>make menuconfig</c>. This
127     will fire up an ncurses-based configuration menu.
128     </p>
129    
130     <pre caption="Invoking menuconfig">
131     # <i>cd /usr/src/linux</i>
132     # <i>make menuconfig</i>
133     </pre>
134    
135     <p>
136     You will be greeted with several configuration sections. We'll first list some
137     options you must activate (otherwise Gentoo will not function, or not function
138     properly without additional tweaks).
139     </p>
140    
141     </body>
142     </subsection>
143     <subsection>
144     <title>Activating Required Options</title>
145     <body>
146    
147     <p>
148     First of all, activate the use of development and experimental code/drivers.
149     You need this, otherwise some very important code/drivers won't show up:
150     </p>
151    
152 fox2mike 1.26 <pre caption="Selecting experimental code/drivers, General setup">
153 swift 1.1 Code maturity level options ---&gt;
154     [*] Prompt for development and/or incomplete code/drivers
155 fox2mike 1.26 General setup ---&gt;
156     [*] Support for hot-pluggable devices
157 swift 1.1 </pre>
158    
159     <p>
160     Now go to <c>File Systems</c> and select support for the filesystems you use.
161     <e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
162 vapier 1.22 able to mount your partitions. Also select <c>Virtual memory</c> and <c>/proc
163     file system</c>. If you are using a 2.4 kernel, you should also select the
164     <c>/dev file system</c> and <c>Automatically mount at boot</c> options, and
165     you should make sure to <c>emerge devfsd</c>.
166 swift 1.1 </p>
167    
168     <pre caption="Selecting necessary file systems">
169 neysx 1.4 <comment>(With a 2.4.x kernel)</comment>
170 swift 1.1 File systems ---&gt;
171     [*] Virtual memory file system support (former shm fs)
172     [*] /proc file system support
173     [*] /dev file system support (EXPERIMENTAL)
174     [*] Automatically mount at boot
175 neysx 1.4 [ ] /dev/pts file system for Unix98 PTYs
176 swift 1.1
177 neysx 1.4 <comment>(With a 2.6.x kernel)</comment>
178     File systems ---&gt;
179     Pseudo Filesystems ---&gt;
180     [*] /proc file system support
181 swift 1.21 [ ] /dev file system support (OBSOLETE)
182 neysx 1.4 [*] Virtual memory file system support (former shm fs)
183 swift 1.1
184     <comment>(Select one or more of the following options as needed by your system)</comment>
185     &lt;*&gt; Reiserfs support
186     &lt;*&gt; Ext3 journalling file system support
187     &lt;*&gt; JFS filesystem support
188     &lt;*&gt; Second extended fs support
189     &lt;*&gt; XFS filesystem support
190     </pre>
191    
192     <p>
193     If you are using PPPoE to connect to the Internet or you are using a dial-up
194     modem, you will need the following options in the kernel:
195     </p>
196    
197     <pre caption="Selecting PPPoE necessary drivers">
198 neysx 1.4 <comment>(With a 2.4.x kernel)</comment>
199 swift 1.1 Network device support ---&gt;
200     &lt;*&gt; PPP (point-to-point protocol) support
201     &lt;*&gt; PPP support for async serial ports
202     &lt;*&gt; PPP support for sync tty ports
203 neysx 1.4
204     <comment>(With a 2.6.x kernel)</comment>
205     Device Drivers ---&gt;
206     Networking support ---&gt;
207     &lt;*&gt; PPP (point-to-point protocol) support
208     &lt;*&gt; PPP support for async serial ports
209     &lt;*&gt; PPP support for sync tty ports
210 swift 1.1 </pre>
211    
212     <p>
213     The two compression options won't harm but are not definitely needed, neither
214     does the <c>PPP over Ethernet</c> option, that might only be used by
215     <c>rp-pppoe</c> when configured to do kernel mode PPPoE.
216     </p>
217    
218     <p>
219     If you require it, don't forget to include support in the kernel for your
220     ethernet card.
221     </p>
222    
223     <p>
224 vapier 1.9 The following options are recommended as well:
225 swift 1.1 </p>
226    
227 vapier 1.9 <pre caption="Recommended Alpha options">
228 swift 1.1 General setup ---&gt;
229     &lt;*&gt; SRM environment through procfs
230     &lt;*&gt; Configure uac policy via sysctl
231    
232     Plug and Play configuration ---&gt;
233     &lt;*&gt; Plug and Play support
234     &lt;M&gt; ISA Plug and Play support
235    
236     SCSI support ---&gt;
237     SCSI low-level drivers ---&gt;
238     &lt;*&gt; SYM53C8XX Version 2 SCSI support (NEW)
239     &lt;*&gt; Qlogic ISP SCSI support
240    
241     Network device support ---&gt;
242     Ethernet (10 or 100 Mbit) ---&gt;
243     &lt;M&gt; DECchip Tulip (dc21x4x) PCI support
244     &lt;M&gt; Generic DECchip &amp; DIGITAL EtherWORKS PCI/EISA
245     &lt;M&gt; EtherExpressPro/100 support (eepro100)
246     &lt;M&gt; EtherExpressPro/100 support (e100)
247     Ethernet (1000 Mbit) ---&gt;
248     &lt;M&gt; Alteon AceNIC
249     [*] Omit support for old Tigon I
250     &lt;M&gt; Broadcom Tigon3
251     [*] FDDI driver support
252     &lt;M&gt; Digital DEFEA and DEFPA
253     &lt;*&gt; PPP support
254     &lt;*&gt; PPP Deflate compression
255    
256     Character devices ---&gt;
257     [*] Support for console on serial port
258     [*] Direct Rendering Manager
259    
260     File systems ---&gt;
261     &lt;*&gt; Kernel automounter version 4 support
262     Network File Systems ---&gt;
263     &lt;*&gt; NFS
264     [*] NFSv3 client
265     &lt;*&gt; NFS server
266     [*] NFSv3 server
267     Partition Types ---&gt;
268     [*] Advanced partition selection
269     [*] Alpha OSF partition support
270     Native Language Support
271     &lt;*&gt; NLS ISO 8859-1
272    
273     Sound ---&gt;
274     &lt;M&gt; Sound card support
275     &lt;M&gt; OSS sound modules
276     [*] Verbose initialisation
277     [*] Persistent DMA buffers
278     &lt;M&gt; 100% Sound Blaster compatibles
279     </pre>
280    
281     <p>
282     When you've finished configuring the kernel, continue with <uri
283     link="#compiling">Compiling and Installing</uri>.
284     </p>
285    
286     </body>
287     </subsection>
288     <subsection id="compiling">
289     <title>Compiling and Installing</title>
290     <body>
291    
292     <p>
293     Now that your kernel is configured, it is time to compile and install it. Exit
294 swift 1.20 the configuration and start the compilation process:
295 swift 1.1 </p>
296    
297     <pre caption="Compiling the kernel">
298     <comment>(For 2.4 kernel)</comment>
299     # <i>make dep &amp;&amp; make vmlinux modules modules_install</i>
300    
301     <comment>(For 2.6 kernel)</comment>
302     # <i>make &amp;&amp; make modules_install</i>
303 vapier 1.6
304     <comment>(For all kernels)</comment>
305     # <i>make boot</i>
306 swift 1.1 </pre>
307    
308     <p>
309 neysx 1.7 When the kernel has finished compiling, copy the kernel image to
310 swift 1.1 <path>/boot</path>. In the next example we assume you have configured and
311 swift 1.21 compiled <c>vanilla-sources-2.6.11.2</c>; recent kernels might create
312 swift 1.10 <path>vmlinux</path> instead of <path>vmlinux.gz</path>.
313 swift 1.1 </p>
314    
315     <pre caption="Installing the kernel">
316 vapier 1.6 # <i>cp arch/alpha/boot/vmlinux.gz /boot/</i>
317 swift 1.21 # <i>cp System.map /boot/System.map-2.6.11.2</i>
318 swift 1.1 </pre>
319    
320     <p>
321     It is also wise to copy over your kernel configuration file to
322     <path>/boot</path>, just in case :)
323     </p>
324    
325     <pre caption="Backing up your kernel configuration">
326 swift 1.21 # <i>cp .config /boot/config-2.6.11.2</i>
327 swift 1.1 </pre>
328    
329     <p>
330     Now continue with <uri link="#kernel_modules">Installing Separate Kernel
331     Modules</uri>.
332     </p>
333    
334     </body>
335     </subsection>
336     </section>
337     <section id="genkernel">
338     <title>Alternative: Using genkernel</title>
339     <body>
340    
341     <p>
342     If you are reading this section, you have chosen to use our <c>genkernel</c>
343     script to configure your kernel for you.
344     </p>
345    
346     <p>
347     Now that your kernel source tree is installed, it's now time to compile your
348     kernel by using our <c>genkernel</c> script to automatically build a kernel for
349     you. <c>genkernel</c> works by configuring a kernel nearly identically to the
350 swift 1.21 way our Installation CD kernel is configured. This means that when you use
351 swift 1.1 <c>genkernel</c> to build your kernel, your system will generally detect all
352 swift 1.21 your hardware at boot-time, just like our Installation CD does. Because genkernel
353 swift 1.1 doesn't require any manual kernel configuration, it is an ideal solution for
354     those users who may not be comfortable compiling their own kernels.
355     </p>
356    
357     <p>
358     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
359     </p>
360    
361     <pre caption="Emerging genkernel">
362     # <i>emerge genkernel</i>
363     </pre>
364    
365     <p>
366     Now, compile your kernel sources by running <c>genkernel all</c>.
367     Be aware though, as <c>genkernel</c> compiles a kernel that supports almost all
368     hardware, this compilation will take quite a while to finish!
369     </p>
370    
371     <p>
372     Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you
373     need to manually configure your kernel using <c>genkernel --menuconfig all</c>
374     and add support for your filesystem <e>in</e> the kernel (i.e. <e>not</e> as a
375     module).
376     </p>
377    
378     <pre caption="Running genkernel">
379     # <i>genkernel all</i>
380     GenKernel v3.0.1_beta10
381     * ARCH: Alpha
382 swift 1.21 * KERNEL VER: 2.6.11.2
383 swift 1.1 * kernel: configuring source
384     * kernel: running mrproper
385     <comment>(Output removed to increase readability)</comment>
386     * Kernel compiled successfully!
387     * Required Kernel Params:
388     * : root=/dev/ram0 init=/linuxrc real_root=/dev/$ROOT
389     * where $ROOT is the devicenode for your root partition as
390     * you should have specified in /etc/fstab
391     *
392     * You MUST tell your bootloader to use the generated initrd
393     *
394     * Recommended Kernel Params:
395     * : vga=0x317 splash=verbose
396     *
397     * Do NOT report kernel bugs (configs included) as genkernel bugs.
398     * Make sure you have the latest genkernel before reporting bugs
399     *
400     * For more info see /usr/share/genkernel/README
401     </pre>
402    
403     <p>
404     Once <c>genkernel</c> completes, a kernel, full set of modules and
405     <e>initial root disk</e> (initrd) will be created. We will use the kernel
406     and initrd when configuring a boot loader later in this document. Write
407     down the names of the kernel and initrd as you will need it when writing
408     the bootloader configuration file. The initrd will be started immediately after
409 swift 1.21 booting to perform hardware autodetection (just like on the Installation CD) before
410 swift 1.1 your "real" system starts up.
411     </p>
412    
413     <pre caption="Checking the created kernel image name and initrd">
414     # <i>ls /boot/kernel* /boot/initrd*</i>
415     </pre>
416    
417     <p>
418 swift 1.21 Now, let's perform one more step to get our system to be more like the Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects hardware that
419 swift 1.14 is needed to boot your system, <c>coldplug</c> autodetects everything else.
420     To emerge and enable <c>coldplug</c>, type the following:
421 swift 1.1 </p>
422    
423 swift 1.14 <pre caption="Emerging and enabling coldplug">
424     # <i>emerge coldplug</i>
425 swift 1.17 # <i>rc-update add coldplug boot</i>
426     </pre>
427    
428     <p>
429     If you want your system to react to hotplugging events, you would need to
430 swift 1.27 install hotplug as well:
431 swift 1.17 </p>
432    
433 swift 1.27 <pre caption="Emerging hotplug">
434 swift 1.17 # <i>emerge hotplug</i>
435 swift 1.1 </pre>
436    
437     </body>
438     </section>
439     <section id="kernel_modules">
440     <title>Installing Separate Kernel Modules</title>
441     <subsection>
442     <title>Installing Extra Modules</title>
443     <body>
444    
445     <p>
446     If appropriate, you should emerge ebuilds for any additional hardware that is
447     on your system. Here is a list of kernel-related ebuilds that you could emerge:
448     </p>
449    
450     <table>
451     <tcolumn width="1in"/>
452     <tcolumn width="4in"/>
453     <tcolumn width="2in"/>
454     <tr>
455     <th>Ebuild</th>
456     <th>Purpose</th>
457     <th>Command</th>
458     </tr>
459     <tr>
460 swift 1.21 <ti>x11-drm</ti>
461 swift 1.1 <ti>
462     Accelerated graphics for ATI Radeon up to 9200, Rage128, Matrox, Voodoo and
463 swift 1.21 other cards for xorg-x11. Please check the <c>IUSE_VIDEO_CARDS</c> variable
464     in the <path>/usr/portage/x11-base/x11-drm</path> ebuilds to see what you
465     need to fill in as <c>yourcard</c>.
466 swift 1.1 </ti>
467 swift 1.21 <ti><c>VIDEO_CARDS="yourcard" emerge x11-drm</c></ti>
468 swift 1.1 </tr>
469     </table>
470    
471     <p>
472     Beware though, some of these ebuilds might deal with big dependencies. To verify
473     what packages will be installed by emerging an ebuild, use <c>emerge
474 swift 1.21 --pretend</c>. For instance, for the <c>x11-drm</c> package:
475 swift 1.1 </p>
476    
477     <pre caption="View full installation package listing">
478 swift 1.21 # <i>emerge --pretend x11-drm</i>
479 swift 1.1 </pre>
480    
481     </body>
482     </subsection>
483     <subsection>
484     <title>Configuring the Modules</title>
485     <body>
486    
487     <p>
488     You should list the modules you want automatically loaded in
489     <path>/etc/modules.autoload.d/kernel-2.4</path> (or <path>kernel-2.6</path>).
490     You can add extra options to the modules too if you want.
491     </p>
492    
493     <p>
494     To view all available modules, run the following <c>find</c> command. Don't
495     forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
496     just compiled:
497     </p>
498    
499     <pre caption="Viewing all available modules">
500     # <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
501     </pre>
502    
503     <p>
504     For instance, to automatically load the <c>3c59x.o</c> module, edit the
505     <path>kernel-2.4</path> or <path>kernel-2.6</path> file and enter the module
506     name in it.
507     </p>
508    
509     <pre caption="Editing /etc/modules.autoload.d/kernel-2.4">
510     <comment>(Example for 2.4 kernels)</comment>
511     # <i>nano -w /etc/modules.autoload.d/kernel-2.4</i>
512     </pre>
513    
514     <pre caption="/etc/modules.autoload.d/kernel-2.4 or kernel-2.6">
515     3c59x
516     </pre>
517    
518     <p>
519     Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
520     your System</uri>.
521     </p>
522    
523     </body>
524     </subsection>
525     </section>
526     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20