/[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.51 - (hide annotations) (download) (as text)
Sun May 20 04:16:25 2007 UTC (7 years, 3 months ago) by nightmorph
Branch: MAIN
Changes since 1.50: +14 -3 lines
File MIME type: application/xml
for safety's sake, needed to move the conf.d/clock TIMEZONE edit to immediately before compiling a kernel. users still run into the warning message if it's left at the end, before rebooting. fixes http://forums.gentoo.org/viewtopic-t-560322.html and other reports.

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

  ViewVC Help
Powered by ViewVC 1.1.20