/[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.61 - (hide annotations) (download) (as text)
Wed Jul 21 00:52:41 2010 UTC (4 years, 1 month ago) by nightmorph
Branch: MAIN
Changes since 1.60: +44 -42 lines
File MIME type: application/xml
Update the PPC handbook for the autobuilds. Major version bump for this release. Fixes bug 260403, bug 292726, and bug 234310.

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

  ViewVC Help
Powered by ViewVC 1.1.20