/[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.60 - (hide annotations) (download) (as text)
Thu Aug 21 14:47:23 2008 UTC (6 years ago) by swift
Branch: MAIN
Changes since 1.59: +26 -26 lines
File MIME type: application/xml
Some coding style changes (trailing whitespace, no tabs)

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

  ViewVC Help
Powered by ViewVC 1.1.20