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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.6 Revision 1.48
1<?xml version='1.0' encoding='UTF-8'?> 1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
5<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-alpha-kernel.xml,v 1.6 2004/08/21 04:43:14 vapier Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-alpha-kernel.xml,v 1.48 2011/08/12 19:05:02 swift Exp $ -->
8 8
9<sections> 9<sections>
10
11<version>11</version>
12<date>2011-08-12</date>
13
10<section> 14<section>
11<title>Timezone</title> 15<title>Timezone</title>
12<body> 16<body>
13 17
14<p> 18<p>
15You first need to select your timezone so that your system knows where it is 19You first need to select your timezone so that your system knows where it is
16located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then make a 20located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy
17symlink to <path>/etc/localtime</path> using <c>ln</c>: 21it to <path>/etc/localtime</path>. Please avoid the
22<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
23indicate the expected zones. For instance, <path>GMT-8</path> is in fact
24GMT+8.
18</p> 25</p>
19 26
20<pre caption="Setting the timezone information"> 27<pre caption="Setting the timezone information">
21# <i>ls /usr/share/zoneinfo</i> 28# <i>ls /usr/share/zoneinfo</i>
22<comment>(Suppose you want to use GMT)</comment> 29<comment>(Suppose you want to use GMT)</comment>
23# <i>ln -sf /usr/share/zoneinfo/GMT /etc/localtime</i> 30# <i>cp /usr/share/zoneinfo/GMT /etc/localtime</i>
24</pre> 31</pre>
25 32
26</body> 33</body>
27</section> 34</section>
28<section> 35<section>
38available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel 45available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
39Guide</uri>. 46Guide</uri>.
40</p> 47</p>
41 48
42<p> 49<p>
43For alpha-based systems we have <c>vanilla-sources</c> (the default kernel 50For alpha-based systems we have <c>gentoo-sources</c> (the default 2.6 kernel
44source as developed by the linux-kernel developers), <c>alpha-sources</c> 51source).
45(kernel source optimized for alpha users) and <c>compaq-sources</c> (kernel
46source as used by RedHat for Alpha, maintained by Compaq).
47</p>
48
49<p>
50Choose your kernel source and install it using <c>emerge</c>.
51</p>
52
53<p>
54In the next example we install the <c>vanilla-sources</c>.
55Of course substitute with your choice of sources, this is merely an example:
56</p> 52</p>
57 53
58<pre caption="Installing a kernel source"> 54<pre caption="Installing a kernel source">
59# <i>emerge vanilla-sources</i> 55# <i>emerge gentoo-sources</i>
60</pre> 56</pre>
61 57
62<p> 58<p>
63When you take a look in <path>/usr/src</path> you should see a symlink called 59When you take a look in <path>/usr/src</path> you should see a symlink called
64<path>linux</path> pointing to your kernel source: 60<path>linux</path> pointing to your kernel source. In this case, the installed
61kernel source points to <c>gentoo-sources-<keyval id="kernel-version"/></c>.
62Your version may be different, so keep this in mind.
65</p> 63</p>
66 64
67<pre caption="Viewing the kernel source symlink"> 65<pre caption="Viewing the kernel source symlink">
68# <i>ls -l /usr/src/linux</i> 66# <i>ls -l /usr/src/linux</i>
69lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-2.4.24 67lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
70</pre> 68</pre>
71 69
72<p>
73If this isn't the case (i.e. the symlink points to a different kernel source)
74change the symlink before you continue:
75</p> 70<p>
76
77<pre caption="Changing the kernel source symlink">
78# <i>rm /usr/src/linux</i>
79# <i>cd /usr/src</i>
80# <i>ln -s linux-2.4.24 linux</i>
81</pre>
82
83<p>
84Now it is time to configure and compile your kernel source. You 71Now it is time to configure and compile your kernel source. You can use
85can use <c>genkernel</c> for this, which will build a generic kernel as used 72<c>genkernel</c> for this, which will build a generic kernel as used by the
86by the LiveCD. We explain the "manual" configuration first though, as it is 73Installation CD. We explain the "manual" configuration first though, as it is
87the best way to optimize your environment. 74the best way to optimize your environment.
88</p> 75</p>
89 76
90<p> 77<p>
91If you want to manually configure your kernel, continue now with <uri 78If you want to manually configure your kernel, continue now with <uri
92link="#manual">Default: Manual Configuration</uri>. If you want to use 79link="#manual">Default: Manual Configuration</uri>. If you want to use
93<c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using 80<c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
94genkernel</uri> instead. 81genkernel</uri> instead.
95</p> 82</p>
96 83
97</body> 84</body>
98</subsection> 85</subsection>
102<subsection> 89<subsection>
103<title>Introduction</title> 90<title>Introduction</title>
104<body> 91<body>
105 92
106<p> 93<p>
107Manually configuring a kernel is often seen as the most difficult course every 94Manually configuring a kernel is often seen as the most difficult procedure a
108Linux users ever has to go through. Nothing is less true -- after configuring a 95Linux user ever has to perform. Nothing is less true -- after configuring a
109couple of kernels you don't even remember that it was difficult ;) 96couple of kernels you don't even remember that it was difficult ;)
110</p> 97</p>
111 98
112<p> 99<p>
113However, one thing <e>is</e> true: you must know your system when you start 100However, one thing <e>is</e> true: you must know your system when you start
114configuring a kernel manually. Most information can be gathered by viewing the 101configuring a kernel manually. Most information can be gathered by emerging
115contents of <path>/proc/pci</path> (or by using <c>lspci</c> if available). You 102pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
103be able to use <c>lspci</c> within the chrooted environment. You may safely
104ignore any <e>pcilib</e> warnings (like pcilib: cannot open
105/sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
106<c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
116can also run <c>lsmod</c> to see what kernel modules the LiveCD uses (it might 107You can also run <c>lsmod</c> to see what kernel modules the Installation CD
117provide you with a nice hint on what to enable). 108uses (it might provide you with a nice hint on what to enable).
118</p> 109</p>
119 110
120<p> 111<p>
121Now go to your kernel source directory and execute <c>make menuconfig</c>. This 112Now go to your kernel source directory and execute <c>make menuconfig</c>. This
122will fire up an ncurses-based configuration menu. 113will fire up an ncurses-based configuration menu.
138<subsection> 129<subsection>
139<title>Activating Required Options</title> 130<title>Activating Required Options</title>
140<body> 131<body>
141 132
142<p> 133<p>
143First of all, activate the use of development and experimental code/drivers.
144You need this, otherwise some very important code/drivers won't show up:
145</p>
146
147<pre caption="Selecting experimental code/drivers">
148Code maturity level options ---&gt;
149 [*] Prompt for development and/or incomplete code/drivers
150</pre>
151
152<p>
153Now go to <c>File Systems</c> and select support for the filesystems you use. 134First go to <c>File Systems</c> and select support for the filesystems you use.
154<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be 135<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
155able to mount your partitions. Also select <c>Virtual memory</c>, <c>/proc 136able to mount your partitions. Also select <c>Virtual memory</c> and <c>/proc
156file system</c>, <c>/dev file system</c> + <c>Automatically mount at boot</c>: 137file system</c>.
157</p> 138</p>
158 139
159<pre caption="Selecting necessary file systems"> 140<pre caption="Selecting necessary file systems">
160<comment>(With a 2.4.x kernel)</comment>
161File systems ---&gt;
162 [*] Virtual memory file system support (former shm fs)
163 [*] /proc file system support
164 [*] /dev file system support (EXPERIMENTAL)
165 [*] Automatically mount at boot
166 [ ] /dev/pts file system for Unix98 PTYs
167
168<comment>(With a 2.6.x kernel)</comment>
169File systems ---&gt; 141File systems ---&gt;
170 Pseudo Filesystems ---&gt; 142 Pseudo Filesystems ---&gt;
171 [*] /proc file system support 143 [*] /proc file system support
172 [*] /dev file system support (OBSOLETE)
173 [*] Automatically mount at boot
174 [*] Virtual memory file system support (former shm fs) 144 [*] Virtual memory file system support (former shm fs)
175 145
176<comment>(Select one or more of the following options as needed by your system)</comment> 146<comment>(Select one or more of the following options as needed by your system)</comment>
177 &lt;*&gt; Reiserfs support 147 &lt;*&gt; Reiserfs support
178 &lt;*&gt; Ext3 journalling file system support 148 &lt;*&gt; Ext3 journalling file system support
185If you are using PPPoE to connect to the Internet or you are using a dial-up 155If you are using PPPoE to connect to the Internet or you are using a dial-up
186modem, you will need the following options in the kernel: 156modem, you will need the following options in the kernel:
187</p> 157</p>
188 158
189<pre caption="Selecting PPPoE necessary drivers"> 159<pre caption="Selecting PPPoE necessary drivers">
190<comment>(With a 2.4.x kernel)</comment>
191Network device support ---&gt;
192 &lt;*&gt; PPP (point-to-point protocol) support
193 &lt;*&gt; PPP support for async serial ports
194 &lt;*&gt; PPP support for sync tty ports
195
196<comment>(With a 2.6.x kernel)</comment>
197Device Drivers ---&gt; 160Device Drivers ---&gt;
198 Networking support ---&gt; 161 Networking support ---&gt;
199 &lt;*&gt; PPP (point-to-point protocol) support 162 &lt;*&gt; PPP (point-to-point protocol) support
200 &lt;*&gt; PPP support for async serial ports 163 &lt;*&gt; PPP support for async serial ports
201 &lt;*&gt; PPP support for sync tty ports 164 &lt;*&gt; PPP support for sync tty ports
202</pre> 165</pre>
203 166
204<p> 167<p>
205The two compression options won't harm but are not definitely needed, neither 168The two compression options won't harm but are not definitely needed, neither
206does the <c>PPP over Ethernet</c> option, that might only be used by 169does the <c>PPP over Ethernet</c> option, that might only be used by <c>ppp</c>
207<c>rp-pppoe</c> when configured to do kernel mode PPPoE. 170when configured to do kernel mode PPPoE.
208</p> 171</p>
209 172
210<p> 173<p>
211If you require it, don't forget to include support in the kernel for your 174If you require it, don't forget to include support in the kernel for your
212ethernet card. 175ethernet card.
213</p> 176</p>
214 177
215<p> 178<p>
216The following Alpha-specific options are recommended as well: 179The following options are recommended as well:
217</p> 180</p>
218 181
219<pre caption="Alpha-specific options"> 182<pre caption="Recommended Alpha options">
220General setup ---&gt; 183General setup ---&gt;
221 &lt;*&gt; SRM environment through procfs 184 &lt;*&gt; SRM environment through procfs
222 &lt;*&gt; Configure uac policy via sysctl 185 &lt;*&gt; Configure uac policy via sysctl
223 186
224Plug and Play configuration ---&gt; 187Plug and Play configuration ---&gt;
281<title>Compiling and Installing</title> 244<title>Compiling and Installing</title>
282<body> 245<body>
283 246
284<p> 247<p>
285Now that your kernel is configured, it is time to compile and install it. Exit 248Now that your kernel is configured, it is time to compile and install it. Exit
286the configuration and run <c>make dep &amp;&amp; make vmlinux modules 249the configuration and start the compilation process:
287modules_install</c>:
288</p> 250</p>
289 251
290<pre caption="Compiling the kernel"> 252<pre caption="Compiling the kernel">
291<comment>(For 2.4 kernel)</comment>
292# <i>make dep &amp;&amp; make vmlinux modules modules_install</i>
293
294<comment>(For 2.6 kernel)</comment>
295# <i>make &amp;&amp; make modules_install</i> 253# <i>make &amp;&amp; make modules_install</i>
296
297<comment>(For all kernels)</comment>
298# <i>make boot</i> 254# <i>make boot</i>
299</pre> 255</pre>
300 256
301<p> 257<p>
302When the kernel is done compiling, copy over the kernel image to 258When the kernel has finished compiling, copy the kernel image to
303<path>/boot</path>. In the next example we assume you have configured and 259<path>/boot</path>. Recent kernels might create <path>vmlinux</path> instead of
304compiled <c>vanilla-sources-2.4.24</c>: 260<path>vmlinux.gz</path>. Keep this in mind when you copy your kernel image.
305</p> 261</p>
306 262
307<pre caption="Installing the kernel"> 263<pre caption="Installing the kernel">
308# <i>cp arch/alpha/boot/vmlinux.gz /boot/</i> 264# <i>cp arch/alpha/boot/vmlinux.gz /boot/</i>
309# <i>cp System.map /boot/System.map-2.4.24</i>
310</pre> 265</pre>
311 266
312<p>
313It is also wise to copy over your kernel configuration file to
314<path>/boot</path>, just in case :)
315</p> 267<p>
316 268Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
317<pre caption="Backing up your kernel configuration">
318# <i>cp .config /boot/config-2.4.24</i>
319</pre>
320
321<p>
322Now continue with <uri link="#kernel_modules">Installing Separate Kernel
323Modules</uri>.
324</p> 269</p>
325 270
326</body> 271</body>
327</subsection> 272</subsection>
328</section> 273</section>
334If you are reading this section, you have chosen to use our <c>genkernel</c> 279If you are reading this section, you have chosen to use our <c>genkernel</c>
335script to configure your kernel for you. 280script to configure your kernel for you.
336</p> 281</p>
337 282
338<p> 283<p>
339Now that your kernel source tree is installed, it's now time to compile your 284Now that your kernel source tree is installed, it's now time to compile your
340kernel by using our <c>genkernel</c> script to automatically build a kernel for 285kernel by using our <c>genkernel</c> script to automatically build a kernel for
341you. <c>genkernel</c> works by configuring a kernel nearly identically to the 286you. <c>genkernel</c> works by configuring a kernel nearly identically to the
342way our LiveCD kernel is configured. This means that when you use 287way our Installation CD kernel is configured. This means that when you use
343<c>genkernel</c> to build your kernel, your system will generally detect all 288<c>genkernel</c> to build your kernel, your system will generally detect all
344your hardware at boot-time, just like our Live CD does. Because genkernel 289your hardware at boot-time, just like our Installation CD does. Because
345doesn't require any manual kernel configuration, it is an ideal solution for 290genkernel doesn't require any manual kernel configuration, it is an ideal
346those users who may not be comfortable compiling their own kernels. 291solution for those users who may not be comfortable compiling their own
292kernels.
347</p> 293</p>
348 294
349<p> 295<p>
350Now, let's see how to use genkernel. First, emerge the genkernel ebuild: 296Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
351</p> 297</p>
367module). 313module).
368</p> 314</p>
369 315
370<pre caption="Running genkernel"> 316<pre caption="Running genkernel">
371# <i>genkernel all</i> 317# <i>genkernel all</i>
372GenKernel v3.0.1_beta10
373* ARCH: Alpha
374* KERNEL VER: 2.4.24
375* kernel: configuring source
376* kernel: running mrproper
377<comment>(Output removed to increase readability)</comment>
378* Kernel compiled successfully!
379* Required Kernel Params:
380* : root=/dev/ram0 init=/linuxrc real_root=/dev/$ROOT
381* where $ROOT is the devicenode for your root partition as
382* you should have specified in /etc/fstab
383*
384* You MUST tell your bootloader to use the generated initrd
385*
386* Recommended Kernel Params:
387* : vga=0x317 splash=verbose
388*
389* Do NOT report kernel bugs (configs included) as genkernel bugs.
390* Make sure you have the latest genkernel before reporting bugs
391*
392* For more info see /usr/share/genkernel/README
393</pre> 318</pre>
394 319
395<p> 320<p>
396Once <c>genkernel</c> completes, a kernel, full set of modules and 321Once <c>genkernel</c> completes, a kernel, full set of modules and <e>initial
397<e>initial root disk</e> (initrd) will be created. We will use the kernel 322ram disk</e> (initramfs) will be created. We will use the kernel and initrd when
398and initrd when configuring a boot loader later in this document. Write 323configuring a boot loader later in this document. Write down the names of the
399down the names of the kernel and initrd as you will need it when writing 324kernel and initrd as you will need it when writing the bootloader configuration
400the bootloader configuration file. The initrd will be started immediately after 325file. The initrd will be started immediately after booting to perform hardware
401booting to perform hardware autodetection (just like on the Live CD) before 326autodetection (just like on the Installation CD) before your "real" system
402your "real" system starts up. 327starts up.
403</p> 328</p>
404 329
405<pre caption="Checking the created kernel image name and initrd"> 330<pre caption="Checking the created kernel image name and initrd">
406# <i>ls /boot/kernel* /boot/initrd*</i> 331# <i>ls /boot/kernel* /boot/initramfs-*</i>
407</pre>
408
409<p>
410Now, let's perform one more step to get our system to be more like the Live
411CD -- let's emerge <c>hotplug</c>. While the initrd autodetects hardware that
412is needed to boot your system, <c>hotplug</c> autodetects everything else.
413To emerge and enable <c>hotplug</c>, type the following:
414</p>
415
416<pre caption="Emerging and enabling hotplug">
417# <i>emerge hotplug</i>
418# <i>rc-update add hotplug default</i>
419</pre> 332</pre>
420 333
421</body> 334</body>
422</section> 335</section>
423<section id="kernel_modules"> 336<section id="kernel_modules">
424<title>Installing Separate Kernel Modules</title> 337<title>Kernel Modules</title>
338
425<subsection> 339<subsection>
426<title>Installing Extra Modules</title> 340<include href="hb-install-kernelmodules.xml"/>
427<body>
428
429<p>
430If appropriate, you should emerge ebuilds for any additional hardware that is
431on your system. Here is a list of kernel-related ebuilds that you could emerge:
432</p>
433
434<table>
435<tcolumn width="1in"/>
436<tcolumn width="4in"/>
437<tcolumn width="2in"/>
438<tr>
439 <th>Ebuild</th>
440 <th>Purpose</th>
441 <th>Command</th>
442</tr>
443<tr>
444 <ti>xfree-drm</ti>
445 <ti>
446 Accelerated graphics for ATI Radeon up to 9200, Rage128, Matrox, Voodoo and
447 other cards for XFree86. Please check the <c>IUSE_VIDEO_CARDS</c> variable
448 in the <path>/usr/portage/x11-base/xfree-drm</path> ebuilds to see what you
449 need to fill in as <c>yourcard</c>.
450 </ti>
451 <ti><c>VIDEO_CARDS="yourcard" emerge xfree-drm</c></ti>
452</tr>
453</table>
454
455<p>
456Beware though, some of these ebuilds might deal with big dependencies. To verify
457what packages will be installed by emerging an ebuild, use <c>emerge
458--pretend</c>. For instance, for the <c>xfree-drm</c> package:
459</p>
460
461<pre caption="View full installation package listing">
462# <i>emerge --pretend xfree-drm</i>
463</pre>
464
465</body>
466</subsection>
467<subsection> 341</subsection>
468<title>Configuring the Modules</title>
469<body>
470 342
471<p>
472You should list the modules you want automatically loaded in
473<path>/etc/modules.autoload.d/kernel-2.4</path> (or <path>kernel-2.6</path>).
474You can add extra options to the modules too if you want.
475</p>
476
477<p>
478To view all available modules, run the following <c>find</c> command. Don't
479forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
480just compiled:
481</p>
482
483<pre caption="Viewing all available modules">
484# <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
485</pre>
486
487<p>
488For instance, to automatically load the <c>3c59x.o</c> module, edit the
489<path>kernel-2.4</path> or <path>kernel-2.6</path> file and enter the module
490name in it.
491</p>
492
493<pre caption="Editing /etc/modules.autoload.d/kernel-2.4">
494<comment>(Example for 2.4 kernels)</comment>
495# <i>nano -w /etc/modules.autoload.d/kernel-2.4</i>
496</pre>
497
498<pre caption="/etc/modules.autoload.d/kernel-2.4 or kernel-2.6">
4993c59x
500</pre>
501
502<p>
503Now run <c>modules-update</c> to commit your changes to the
504<path>/etc/modules.conf</path> file:
505</p>
506
507<pre caption="Running modules-update">
508# <i>modules-update</i>
509</pre>
510
511<p>
512Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
513your System</uri>.
514</p>
515
516</body>
517</subsection>
518</section> 343</section>
519</sections> 344</sections>

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.48

  ViewVC Help
Powered by ViewVC 1.1.20