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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.7 - (show annotations) (download) (as text)
Tue Mar 13 00:30:09 2007 UTC (11 years, 4 months ago) by nightmorph
Branch: MAIN
Changes since 1.6: +4 -18 lines
File MIME type: application/xml
Remove all references to coldplug, bug 170679

1 <?xml version='1.0' encoding='UTF-8'?>
2 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
4 <!-- The content of this document is licensed under the CC-BY-SA license -->
5 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
7 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/2006.1/hb-install-ppc-kernel.xml,v 1.6 2007/02/26 08:55:48 nightmorph Exp $ -->
9 <sections>
11 <version>7.5</version>
12 <date>2007-03-12</date>
14 <section>
15 <title>Timezone</title>
16 <body>
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>
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>
32 </body>
33 </section>
34 <section>
35 <title>Installing the Sources</title>
36 <subsection>
37 <title>Choosing a Kernel</title>
38 <body>
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>
48 <p>
49 We suggest using <c>gentoo-sources</c> on PPC, which is a 2.6 kernel.
50 </p>
52 <pre caption="Installing a kernel source">
53 # <i>emerge gentoo-sources</i>
54 </pre>
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>
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>
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>
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>
82 </body>
83 </subsection>
84 </section>
85 <section id="manual">
86 <title>Default: Manual Configuration</title>
87 <subsection>
88 <title>Introduction</title>
89 <body>
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>
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>
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>
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>
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>
132 </body>
133 </subsection>
134 <subsection>
135 <title>Activating Required Options</title>
136 <body>
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>
143 <pre caption="Selecting experimental code/drivers">
144 Code maturity level options ---&gt;
145 [*] Prompt for development and/or incomplete code/drivers
146 </pre>
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>
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
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>
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>
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>
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>
192 <p>
193 If you require it, don't forget to include support in the kernel for your
194 ethernet card.
195 </p>
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>
203 <pre caption="Activating HFS support">
204 File Systems ---&gt;
205 [*] HFS Support
206 </pre>
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>
214 <pre caption="Ensure the Preemptible Kernel Option is Off">
215 Kernel options ---&gt;
216 Preemption Model (No Forced Preemption (Server))
217 </pre>
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>
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>
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>
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>
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>
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>
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>
273 <p>
274 When you're done configuring your kernel, continue with <uri
275 link="#compiling">Compiling and Installing</uri>.
276 </p>
278 </body>
279 </subsection>
280 <subsection id="compiling">
281 <title>Compiling and Installing</title>
282 <body>
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>
289 <pre caption="Compiling the kernel">
290 # <i>make &amp;&amp; make modules_install</i>
291 </pre>
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>
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>
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>
317 <p>
318 Now continue with <uri link="#kernel_modules">Installing Separate Kernel
319 Modules</uri>.
320 </p>
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>
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>
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>
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>
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>
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>
357 <pre caption="/etc/modules.autoload.d/kernel-2.6">
358 3c59x
359 </pre>
361 <p>
362 Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
363 your System</uri>.
364 </p>
366 </body>
367 </subsection>
368 </section>
369 <section id="genkernel">
370 <title>Alternative: Using genkernel</title>
371 <body>
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>
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 genkernel
385 doesn't require any manual kernel configuration, it is an ideal solution for
386 those users who may not be comfortable compiling their own kernels.
387 </p>
389 <p>
390 Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
391 </p>
393 <pre caption="Emerging genkernel">
394 # <i>emerge genkernel</i>
395 </pre>
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>
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>
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>
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>
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>
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>
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 arguments as
441 well.
442 </p>
444 <pre caption="Running genkernel">
445 # <i>genkernel all</i>
446 </pre>
448 <pre caption="Running genkernel on the Pegasos">
449 # <i>genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all</i>
450 </pre>
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>
463 <pre caption="Checking the created kernel image name and initrd">
464 # <i>ls /boot/kernel* /boot/initramfs*</i>
465 </pre>
467 <p>
468 If you want your system to react to hotplugging events, you will need to install
469 and setup <c>hotplug</c>:
470 </p>
472 <pre caption="Emerging and enabling hotplug">
473 # <i>emerge hotplug</i>
474 # <i>rc-update add hotplug default</i>
475 </pre>
477 <p>
478 Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>.
479 </p>
481 </body>
482 </section>
484 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20