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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.41 - (show annotations) (download) (as text)
Fri Jul 21 09:13:28 2006 UTC (11 years, 11 months ago) by rane
Branch: MAIN
Changes since 1.40: +3 -5 lines
File MIME type: application/xml
#132127, removed instructions about turning on Support for hot-pluggable devices, it's on by default since 2.6.16

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.40 2006/05/01 02:50:09 josejx Exp $ -->
9 <sections>
11 <version>2.18</version>
12 <date>2006-07-20</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 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>
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 the 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-gentoo
72 </pre>
74 <p>
75 It is now time to configure and compile your kernel source. You can use
76 <c>genkernel</c> to build a generic kernel similar to the one used by the
77 Installation CD, or you can perform a manual configuration to best suit your
78 system.
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 won't even remember it being that 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. It
120 is recommended that you add the default settings to your configuration by first
121 running <c>make defconfig</c> (for 2.6.15 and earlier kernels) or
122 <c>make pmac32_defconfig</c> (for 2.6.16 and later kernels). After the default
123 configuration has been generated, run <c>make menuconfig</c> which will fire
124 up an ncurses-based configuration menu.
125 </p>
127 <pre caption="Invoking menuconfig">
128 # <i>cd /usr/src/linux</i>
129 <comment>Substitute defconfig for pmac32_defconfig below if using a 2.6.15 or earlier kernel</comment>
130 # <i>make pmac32_defconfig</i>
131 # <i>make menuconfig</i>
132 </pre>
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>
140 </body>
141 </subsection>
142 <subsection>
143 <title>Activating Required Options</title>
144 <body>
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>
151 <pre caption="Selecting experimental code/drivers, General setup">
152 Code maturity level options ---&gt;
153 [*] Prompt for development and/or incomplete code/drivers
154 </pre>
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>/proc file system</c> and
160 <c>Virtual memory</c>.
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)
169 <comment>(Select one or more of the following options as needed by your system)</comment>
170 &lt;*&gt; Second extended fs support
171 &lt;*&gt; Ext3 journalling file system support
172 &lt;*&gt; Reiserfs support
173 &lt;*&gt; XFS filesystem support
174 </pre>
176 <p>
177 If you are using PPPoE to connect to the Internet or you are using a dial-up
178 modem, you will need the following options in the kernel:
179 </p>
181 <pre caption="Selecting PPPoE necessary drivers">
182 Device Drivers ---&gt;
183 Networking support ---&gt;
184 &lt;*&gt; PPP (point-to-point protocol) support
185 &lt;*&gt; PPP support for async serial ports
186 &lt;*&gt; PPP support for sync tty ports
187 </pre>
189 <p>
190 The two compression options won't harm but are not definitely needed, neither
191 does the <c>PPP over Ethernet</c> option, that might only be used by
192 <c>rp-pppoe</c> when configured to do kernel mode PPPoE.
193 </p>
195 <p>
196 If you require it, don't forget to include support in the kernel for your
197 ethernet card.
198 </p>
200 <p>
201 Users of NewWorld and OldWorld machines will want HFS support as well. OldWorld
202 users require it for copying compiled kernels to the MacOS partition. NewWorld
203 users require it for configuring the special Apple_Bootstrap partition:
204 </p>
206 <pre caption="Activating HFS support">
207 File Systems ---&gt;
208 [*] HFS Support
209 </pre>
211 <p>
212 At this time, kernel preemption is still unstable on PPC and may cause
213 compilation failures and random segfaults. It is <e>strongly</e> suggested
214 that you do not use this feature.
215 </p>
217 <pre caption="Ensure the Preemptible Kernel Option is Off">
218 Platform options ---&gt;
219 [ ] Preemptible Kernel
220 </pre>
222 <p>
223 If you're booting from Firewire, you'll need to enable these options. If you
224 do not want to compile in support, you'll need to include these modules and
225 their dependencies in an initrd.
226 </p>
228 <pre caption="Enable support for firewire devices on boot">
229 Device Drivers ---&gt;
230 IEEE 1394 (FireWire) support ---&gt;
231 &lt;*&gt; IEEE 1394 (FireWire) support
232 &lt;*&gt; OHCI-1394 support
233 &lt;*&gt; SBP-2 support (Harddisks etc.)
234 </pre>
236 <p>
237 If you're booting from USB, you'll need to enable these options. If you do not
238 want to compile in support, you'll need to include these modules and their
239 dependencies in an initrd.
240 </p>
242 <pre caption="Enable support for USB devices on boot">
243 Device Drivers ---&gt;
244 USB support ---&gt;
245 &lt;*&gt; Support for Host-side USB
246 &lt;*&gt; OHCI HCD support
247 &lt;*&gt; USB Mass Storage support
248 </pre>
250 <p>
251 Do not turn off kernel framebuffer support as it is required for a successful
252 boot. If you are using an NVIDIA based chipset, you should use the OpenFirmware
253 framebuffer. If you are using an ATI based chipset, you should select the
254 framebuffer driver based upon your chipset (Mach64, Rage128 or Radeon).
255 </p>
257 <pre caption="Chosing a Framebuffer Driver">
258 Device Drivers ---&gt;
259 Graphics support ---&gt;
260 &lt;*&gt; Support for frame buffer devices
261 [*] Open Firmware frame buffer device support
262 &lt;*&gt; ATI Radeon display support
263 &lt;*&gt; ATI Rage128 display support
264 &lt;*&gt; ATI Mach64 display support
265 Console display driver support ---&gt;
266 &lt;*&gt; Framebuffer Console support
267 </pre>
269 <note>
270 If you select more than one framebuffer device, it may default to a less than
271 optimal driver. Either use only one framebuffer device or specify which
272 to use by passing the driver to use to the kernel on boot such as
273 <c>video=radeonfb</c>.
274 </note>
276 <p>
277 When you're done configuring your kernel, continue with <uri
278 link="#compiling">Compiling and Installing</uri>.
279 </p>
281 </body>
282 </subsection>
283 <subsection id="compiling">
284 <title>Compiling and Installing</title>
285 <body>
287 <p>
288 Now that your kernel is configured, it is time to compile and install it. Exit
289 the configuration and run the commands which will compile the kernel:
290 </p>
292 <pre caption="Compiling the kernel">
293 # <i>make &amp;&amp; make modules_install</i>
294 </pre>
296 <p>
297 When the kernel has finished compiling, copy the kernel image to
298 <path>/boot</path> (be sure that it is mounted properly on Pegasos computers).
299 If you are using BootX to boot, we'll copy the kernel later.
300 </p>
302 <p>
303 Yaboot and BootX expect to use an uncompressed kernel unlike many other
304 bootloaders. The uncompressed kernel is called vmlinux and it is placed in
305 <path>/usr/src/linux</path> after the kernel has finished compiling. If you
306 are using a Pegasos machine, the Pegasos firmware requires a compressed
307 kernel called zImage.chrp which can be found in
308 <path>/usr/src/linux/arch/ppc/boot/images</path>.
309 </p>
311 <pre caption="Installing the kernel">
312 # <i>cd /usr/src/linux</i>
313 <comment>replace &lt;kernel-version&gt; with your kernel version</comment>
314 <comment>(Apple/IBM)</comment>
315 # <i>cp vmlinux /boot/&lt;kernel-version&gt;</i>
316 <comment>(Pegasos)</comment>
317 # <i>cp arch/ppc/boot/images/zImage.chrp /boot/&lt;kernel-version&gt;</i>
318 </pre>
320 <p>
321 Now continue with <uri link="#kernel_modules">Installing Separate Kernel
322 Modules</uri>.
323 </p>
325 </body>
326 </subsection>
327 </section>
328 <section id="kernel_modules">
329 <title>Installing Separate Kernel Modules</title>
330 <subsection>
331 <title>Configuring the Modules</title>
332 <body>
334 <p>
335 You should list the modules you want automatically loaded in
336 <path>/etc/modules.autoload.d/kernel-2.6</path>.
337 You can add extra options to the modules too if needed.
338 </p>
340 <p>
341 To view all available modules, run the following <c>find</c> command. Don't
342 forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
343 just compiled:
344 </p>
346 <pre caption="Viewing all available modules">
347 # <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
348 </pre>
350 <p>
351 For instance, to automatically load the <c>3c59x.o</c> module, edit the
352 <path>kernel-2.6</path> file and enter the module
353 name in it.
354 </p>
356 <pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
357 # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
358 </pre>
360 <pre caption="/etc/modules.autoload.d/kernel-2.6">
361 3c59x
362 </pre>
364 <p>
365 Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
366 your System</uri>.
367 </p>
369 </body>
370 </subsection>
371 </section>
372 <section id="genkernel">
373 <title>Alternative: Using genkernel</title>
374 <body>
376 <p>
377 If you are reading this section, you have chosen to use our <c>genkernel</c>
378 script to configure your kernel for you.
379 </p>
381 <p>
382 Now that your kernel source tree is installed, it's now time to compile your
383 kernel by using our <c>genkernel</c> script to automatically build a kernel for
384 you. <c>genkernel</c> works by configuring a kernel nearly identically to the
385 way our Installation CD kernel is configured. This means that when you use
386 <c>genkernel</c> to build your kernel, your system will generally detect all
387 your hardware at boot-time, just like our Installation CD does.
388 Because genkernel doesn't require any manual kernel configuration, it is an
389 ideal solution for those users who may not be comfortable compiling their own
390 kernels.
391 </p>
393 <p>
394 Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
395 </p>
397 <pre caption="Emerging genkernel">
398 # <i>emerge genkernel</i>
399 </pre>
401 <p>
402 Next, copy over the kernel configuration used by the Installation CD to the
403 location where genkernel looks for the default kernel configuration:
404 </p>
406 <pre caption="Copying over the Installation CD kernel config">
407 # <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i>
408 </pre>
410 <p>
411 If you are using firewire or USB to boot, you'll need to add modules to the
412 initrd. Edit <path>/usr/share/genkernel/ppc/modules_load</path> and change
413 <c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for firewire support or
414 <c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support.
415 </p>
417 <p>
418 Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
419 For Pegasos, we will need to use a different config and create a zImage instead
420 of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c>
421 compiles a kernel that supports almost all hardware, this compilation can take
422 quite a while to finish!
423 </p>
425 <p>
426 Note that, if your partition where the kernel should be located doesn't use ext2
427 or ext3 as filesystem you might need to manually configure your kernel using
428 <c>genkernel --menuconfig --genzimage all</c> and add support for your
429 filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or
430 LVM2 will probably want to add <c>--evms2</c> or <c>--lvm2</c> as argument as
431 well.
432 </p>
434 <pre caption="Running genkernel">
435 # <i>genkernel all</i>
436 </pre>
438 <pre caption="Running genkernel on the Pegasos">
439 # <i>genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all</i>
440 </pre>
442 <p>
443 Once <c>genkernel</c> completes, a kernel, full set of modules and
444 <e>initial root disk</e> (initrd) will be created. We will use the kernel
445 and initrd when configuring a boot loader later in this document. Write
446 down the names of the kernel and initrd as you will need it when writing
447 the bootloader configuration file. The initrd will be started immediately after
448 booting to perform hardware autodetection (just like on the Installation CD)
449 before your "real" system starts up. Be sure to also copy down the required
450 boot arguments, these are required for a successful boot with genkernel.
451 </p>
453 <pre caption="Checking the created kernel image name and initrd">
454 # <i>ls /boot/kernel* /boot/initramfs*</i>
455 </pre>
457 <p>
458 Now, let's perform one more step to get our system to be more like the
459 Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects
460 hardware that is needed to boot your system, <c>coldplug</c> autodetects
461 everything else. To emerge and enable <c>coldplug</c>, type the following:
462 </p>
464 <pre caption="Emerging and enabling coldplug">
465 # <i>emerge coldplug</i>
466 # <i>rc-update add coldplug boot</i>
467 </pre>
469 <p>
470 Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>.
471 </p>
473 </body>
474 </section>
476 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20