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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.37 - (show annotations) (download) (as text)
Mon Nov 21 15:37:12 2005 UTC (8 years, 9 months ago) by neysx
Branch: MAIN
Changes since 1.36: +19 -14 lines
File MIME type: application/xml
#112802 USE="-doc" when emerging kernel sources to avoid dependencies (until the USE flags are described later in the handbook)
#110596 (PPC only) Add make defconfig before make menuconfig
#110038 cp time zone file instead of symlinking to 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-ppc-kernel.xml,v 1.36 2005/08/21 17:47:46 neysx Exp $ -->
8
9 <sections>
10
11 <version>2.14</version>
12 <date>2005-11-21</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 base that all distributions are built upon is the Linux kernel. It is the
42 layer between the your 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 We suggest using either <c>vanilla-sources</c> or <c>gentoo-sources</c>
50 on PPC, which are both 2.6 kernels. The latter is available when you
51 perform a networkless installation. So let's continue with <c>emerge</c>'ing
52 the kernel sources.
53 The <c>USE="-doc"</c> is necessary to avoid installing xorg-x11 or other
54 dependencies at this point:
55 </p>
56
57 <pre caption="Installing the kernel source">
58 # <i>USE="-doc" emerge gentoo-sources</i>
59 </pre>
60
61 <note>
62 The suggested sources at the time of the 2005.1 release are
63 <c>gentoo-sources-2.6.12-r4</c> and <c>vanilla-sources-2.6.12.2</c>.
64 </note>
65
66 <p>
67 If you take a look in <path>/usr/src</path> you should see a symlink named
68 <path>linux</path> pointing to your current kernel source. Here, we will assume
69 that the kernel source installed is <c>gentoo-sources-2.6.12-r4</c>:
70 </p>
71
72 <pre caption="Viewing the kernel source symlink">
73 # <i>ls -l /usr/src/linux</i>
74 lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-2.6.12-gentoo-r4
75 </pre>
76
77 <p>
78 If the symlink doesn't point to the kernel source of your choice (note that
79 <c>linux-2.6.12-gentoo-r4</c> is merely an example) you should change it to the
80 desired kernel sources:
81 </p>
82
83 <pre caption="Changing the kernel source symlink">
84 # <i>rm /usr/src/linux</i>
85 # <i>cd /usr/src</i>
86 # <i>ln -s linux-2.6.12-gentoo-r4 linux</i>
87 </pre>
88
89 <p>
90 It is now time to configure and compile your kernel source. You can use
91 <c>genkernel</c> to build a generic kernel similar to the one used by the
92 Installation CD, or you can perform a manual configuration to best suit your
93 system.
94 </p>
95
96 <p>
97 If you want to manually configure your kernel, continue now with <uri
98 link="#manual">Default: Manual Configuration</uri>. If you want to use
99 <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
100 genkernel</uri> instead.
101 </p>
102
103 </body>
104 </subsection>
105 </section>
106 <section id="manual">
107 <title>Default: Manual Configuration</title>
108 <subsection>
109 <title>Introduction</title>
110 <body>
111
112 <p>
113 Manually configuring a kernel is often seen as the most difficult procedure a
114 Linux user ever has to perform. Nothing is less true, after configuring a
115 couple of kernels you won't even remember it being that difficult ;)
116 </p>
117
118 <p>
119 However, one thing <e>is</e> true: you must know your system when you start
120 configuring a kernel manually. Most information can be gathered by emerging
121 pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
122 be able to use <c>lspci</c> within the chrooted environment. You may safely
123 ignore any <e>pcilib</e> warnings (like pcilib: cannot open
124 /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
125 <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
126 You can also run <c>lsmod</c> to see what kernel modules the Installation CD
127 uses (it might provide you with a nice hint on what to enable). Another place
128 to look for clues as to what components to enable is to check the kernel
129 message logs from the successful boot that got you this far. Type <c>dmesg</c>
130 to see the kernel messages.
131 </p>
132
133 <p>
134 Now go to your kernel source directory, it's time to configure your kernel. It
135 is recommended that you add the default settings to your configuration by first
136 running <c>make defconfig</c>. After the default configuration has been
137 generated, run <c>make menuconfig</c> which will fire up an ncurses-based
138 configuration menu.
139 </p>
140
141 <pre caption="Invoking menuconfig">
142 # <i>cd /usr/src/linux</i>
143 # <i>make defconfig</i>
144 # <i>make menuconfig</i>
145 </pre>
146
147 <p>
148 You will be greeted with several configuration sections. We'll first list some
149 options you must activate (otherwise Gentoo will not function, or not function
150 properly without additional tweaks).
151 </p>
152
153 </body>
154 </subsection>
155 <subsection>
156 <title>Activating Required Options</title>
157 <body>
158
159 <p>
160 First of all, activate the use of development and experimental code/drivers.
161 You need this, otherwise some very important code/drivers won't show up:
162 </p>
163
164 <pre caption="Selecting experimental code/drivers, General setup">
165 Code maturity level options ---&gt;
166 [*] Prompt for development and/or incomplete code/drivers
167 General setup --->
168 [*] Support for hot-pluggable devices
169 </pre>
170
171 <p>
172 Now go to <c>File Systems</c> and select support for the filesystems you use.
173 <e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
174 able to mount your partitions. Also select <c>/proc file system</c> and
175 <c>Virtual memory</c>. Do <e>not</e> select the <c>/dev file system</c>.
176 </p>
177
178 <pre caption="Selecting necessary file systems">
179 File systems ---&gt;
180 Pseudo Filesystems ---&gt;
181 [*] /proc file system support
182 [ ] /dev file system support (OBSOLETE)
183 [*] Virtual memory file system support (former shm fs)
184
185 <comment>(Select one or more of the following options as needed by your system)</comment>
186 &lt;*&gt; Second extended fs support
187 &lt;*&gt; Ext3 journalling file system support
188 &lt;*&gt; Reiserfs 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 Device Drivers ---&gt;
199 Networking 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 </pre>
204
205 <p>
206 The two compression options won't harm but are not definitely needed, neither
207 does the <c>PPP over Ethernet</c> option, that might only be used by
208 <c>rp-pppoe</c> when configured to do kernel mode PPPoE.
209 </p>
210
211 <p>
212 If you require it, don't forget to include support in the kernel for your
213 ethernet card.
214 </p>
215
216 <p>
217 Users of NewWorld and OldWorld machines will want HFS support as well. OldWorld
218 users require it for copying compiled kernels to the MacOS partition. NewWorld
219 users require it for configuring the special Apple_Bootstrap partition:
220 </p>
221
222 <pre caption="Activating HFS support">
223 File Systems ---&gt;
224 [*] HFS Support
225 </pre>
226
227 <p>
228 At this time, kernel preemption is still unstable on PPC and may cause
229 compilation failures and random segfaults. It is <e>strongly</e> suggested
230 that you do not use this feature.
231 </p>
232
233 <pre caption="Ensure the Preemptible Kernel Option is Off">
234 Platform options ---&gt;
235 [ ] Preemptible Kernel
236 </pre>
237
238 <p>
239 If you're booting from Firewire, you'll need to enable these options. If you
240 do not want to compile in support, you'll need to include these modules and
241 their dependencies in an initrd.
242 </p>
243
244 <pre caption="Enable support for firewire devices on boot">
245 Device Drivers ---&gt;
246 IEEE 1394 (FireWire) support ---&gt;
247 &lt;*&gt; IEEE 1394 (FireWire) support
248 &lt;*&gt; OHCI-1394 support
249 &lt;*&gt; SBP-2 support (Harddisks etc.)
250 </pre>
251
252 <p>
253 If you're booting from USB, you'll need to enable these options. If you do not
254 want to compile in support, you'll need to include these modules and their
255 dependencies in an initrd.
256 </p>
257
258 <pre caption="Enable support for USB devices on boot">
259 Device Drivers ---&gt;
260 USB support ---&gt;
261 &lt;*&gt; Support for Host-side USB
262 &lt;*&gt; OHCI HCD support
263 &lt;*&gt; USB Mass Storage support
264 </pre>
265
266 <p>
267 Do not turn off kernel framebuffer support as it is required for a successful
268 boot. If you are using an NVIDIA based chipset, you should use the OpenFirmware
269 framebuffer. If you are using an ATI based chipset, you should select the
270 framebuffer driver based upon your chipset (Mach64, Rage128 or Radeon).
271 </p>
272
273 <pre caption="Chosing a Framebuffer Driver">
274 Device Drivers ---&gt;
275 Graphics support ---&gt;
276 &lt;*&gt; Support for frame buffer devices
277 [*] Open Firmware frame buffer device support
278 &lt;*&gt; ATI Radeon display support
279 &lt;*&gt; ATI Rage128 display support
280 &lt;*&gt; ATI Mach64 display support
281 Console display driver support ---&gt;
282 &lt;*&gt; Framebuffer Console support
283 </pre>
284
285 <note>
286 If you select more than one framebuffer device, it may default to a less than
287 optimal driver. Either use only one framebuffer device or specify which
288 to use by passing the driver to use to the kernel on boot such as
289 <c>video=radeonfb</c>.
290 </note>
291
292 <p>
293 When you're done configuring your kernel, continue with <uri
294 link="#compiling">Compiling and Installing</uri>.
295 </p>
296
297 </body>
298 </subsection>
299 <subsection id="compiling">
300 <title>Compiling and Installing</title>
301 <body>
302
303 <p>
304 Now that your kernel is configured, it is time to compile and install it. Exit
305 the configuration and run the commands which will compile the kernel:
306 </p>
307
308 <pre caption="Compiling the kernel">
309 # <i>make &amp;&amp; make modules_install</i>
310 </pre>
311
312 <p>
313 When the kernel has finished compiling, copy the kernel image to
314 <path>/boot</path> (be sure that it is mounted properly on the Pegasos).
315 </p>
316
317 <pre caption="Installing the kernel">
318 <comment>replace 2.6.12 with your kernel-version</comment>
319 (Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.12</i>
320 (Pegasos) # <i>cp arch/ppc/boot/images/zImage.chrp /boot/kernel-2.6.12</i>
321 </pre>
322
323 <p>
324 It is also wise to copy over your kernel configuration file to
325 <path>/boot</path>, just in case :)
326 </p>
327
328 <pre caption="Backing up your kernel configuration">
329 # <i>cp .config /boot/config-2.6.12-gentoo-r4</i>
330 </pre>
331
332 <p>
333 Now continue with <uri link="#kernel_modules">Installing Separate Kernel
334 Modules</uri>.
335 </p>
336
337 </body>
338 </subsection>
339 </section>
340 <section id="kernel_modules">
341 <title>Installing Separate Kernel Modules</title>
342 <subsection>
343 <title>Configuring the Modules</title>
344 <body>
345
346 <p>
347 You should list the modules you want automatically loaded in
348 <path>/etc/modules.autoload.d/kernel-2.6</path>.
349 You can add extra options to the modules too if needed.
350 </p>
351
352 <p>
353 To view all available modules, run the following <c>find</c> command. Don't
354 forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
355 just compiled:
356 </p>
357
358 <pre caption="Viewing all available modules">
359 # <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
360 </pre>
361
362 <p>
363 For instance, to automatically load the <c>3c59x.o</c> module, edit the
364 <path>kernel-2.6</path> file and enter the module
365 name in it.
366 </p>
367
368 <pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
369 # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
370 </pre>
371
372 <pre caption="/etc/modules.autoload.d/kernel-2.6">
373 3c59x
374 </pre>
375
376 <p>
377 Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
378 your System</uri>.
379 </p>
380
381 </body>
382 </subsection>
383 </section>
384 <section id="genkernel">
385 <title>Alternative: Using genkernel</title>
386 <body>
387
388 <p>
389 If you are reading this section, you have chosen to use our <c>genkernel</c>
390 script to configure your kernel for you.
391 </p>
392
393 <p>
394 Now that your kernel source tree is installed, it's now time to compile your
395 kernel by using our <c>genkernel</c> script to automatically build a kernel for
396 you. <c>genkernel</c> works by configuring a kernel nearly identically to the
397 way our Installation CD kernel is configured. This means that when you use
398 <c>genkernel</c> to build your kernel, your system will generally detect all
399 your hardware at boot-time, just like our Installation CD does.
400 Because genkernel doesn't require any manual kernel configuration, it is an
401 ideal solution for those users who may not be comfortable compiling their own
402 kernels.
403 </p>
404
405 <p>
406 Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
407 </p>
408
409 <pre caption="Emerging genkernel">
410 # <i>emerge genkernel</i>
411 </pre>
412
413 <p>
414 Next, copy over the kernel configuration used by the Installation CD to the
415 location where genkernel looks for the default kernel configuration:
416 </p>
417
418 <pre caption="Copying over the Installation CD kernel config">
419 # <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i>
420 </pre>
421
422 <p>
423 If you are using firewire or USB to boot, you'll need to add modules to the
424 initrd. Edit <path>/usr/share/genkernel/ppc/modules_load</path> and change
425 <c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for firewire support or
426 <c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support.
427 </p>
428
429 <p>
430 Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
431 For Pegasos, we will need to use a different config and create a zImage instead
432 of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c>
433 compiles a kernel that supports almost all hardware, this compilation can take
434 quite a while to finish!
435 </p>
436
437 <p>
438 Note that, if your partition where the kernel should be located doesn't use ext2
439 or ext3 as filesystem you might need to manually configure your kernel using
440 <c>genkernel --menuconfig --genzimage all</c> and add support for your
441 filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or
442 LVM2 will probably want to add <c>--evms2</c> or <c>--lvm2</c> as argument as
443 well.
444 </p>
445
446 <pre caption="Running genkernel">
447 # <i>genkernel all</i>
448 </pre>
449
450 <pre caption="Running genkernel on the Pegasos">
451 # <i>genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all</i>
452 </pre>
453
454 <p>
455 Once <c>genkernel</c> completes, a kernel, full set of modules and
456 <e>initial root disk</e> (initrd) will be created. We will use the kernel
457 and initrd when configuring a boot loader later in this document. Write
458 down the names of the kernel and initrd as you will need it when writing
459 the bootloader configuration file. The initrd will be started immediately after
460 booting to perform hardware autodetection (just like on the Installation CD)
461 before your "real" system starts up. Be sure to also copy down the required
462 boot arguments, these are required for a successful boot with genkernel.
463 </p>
464
465 <pre caption="Checking the created kernel image name and initrd">
466 # <i>ls /boot/kernel* /boot/initramfs*</i>
467 </pre>
468
469 <p>
470 Now, let's perform one more step to get our system to be more like the
471 Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects
472 hardware that is needed to boot your system, <c>coldplug</c> autodetects
473 everything else. To emerge and enable <c>coldplug</c>, type the following:
474 </p>
475
476 <pre caption="Emerging and enabling coldplug">
477 # <i>emerge coldplug</i>
478 # <i>rc-update add coldplug boot</i>
479 </pre>
480
481 <p>
482 Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>.
483 </p>
484
485 </body>
486 </section>
487
488 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20