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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.43 - (show annotations) (download) (as text)
Tue Sep 5 16:56:57 2006 UTC (9 years, 2 months ago) by josejx
Branch: MAIN
Changes since 1.42: +6 -6 lines
File MIME type: application/xml
Fixed defconfig->pmac32_defconfig in the handbook.

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

  ViewVC Help
Powered by ViewVC 1.1.20