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