/[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.46 - (show annotations) (download) (as text)
Mon Feb 26 08:54:53 2007 UTC (7 years, 5 months ago) by nightmorph
Branch: MAIN
Changes since 1.45: +5 -11 lines
File MIME type: application/xml
removed USE=symlink by request of dsd as part of the USE flag removal from all kernel sources, bug 167703. also further vanilla-sources removals as it's unsupported.

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

  ViewVC Help
Powered by ViewVC 1.1.20