/[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.41 - (hide annotations) (download) (as text)
Fri Jul 21 09:13:28 2006 UTC (8 years, 1 month 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 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 rane 1.41 <!-- $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 $ -->
8 swift 1.1
9     <sections>
10 swift 1.12
11 rane 1.41 <version>2.18</version>
12     <date>2006-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.37 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     indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8.
24 swift 1.1 </p>
25    
26     <pre caption="Setting the timezone information">
27     # <i>ls /usr/share/zoneinfo</i>
28     <comment>(Suppose you want to use GMT)</comment>
29 neysx 1.37 # <i>cp /usr/share/zoneinfo/GMT /etc/localtime</i>
30 swift 1.1 </pre>
31    
32     </body>
33     </section>
34     <section>
35     <title>Installing the Sources</title>
36     <subsection>
37     <title>Choosing a Kernel</title>
38     <body>
39    
40     <p>
41 swift 1.34 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 swift 1.1 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>
47    
48     <p>
49 neysx 1.38 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 swift 1.1 </p>
57    
58 swift 1.34 <pre caption="Installing the kernel source">
59 neysx 1.38 # <i>USE="-doc symlink" emerge gentoo-sources</i>
60 swift 1.1 </pre>
61    
62     <p>
63 swift 1.34 If you take a look in <path>/usr/src</path> you should see a symlink named
64 neysx 1.38 <path>linux</path> pointing to your current kernel source. In this case, the
65 fox2mike 1.39 installed kernel source points to <c>gentoo-sources-2.6.15</c>. Your version
66 neysx 1.38 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 fox2mike 1.39 lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-2.6.15-gentoo
72 swift 1.1 </pre>
73    
74     <p>
75 swift 1.34 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 swift 1.1 </p>
80    
81     <p>
82 swift 1.19 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 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 swift 1.34 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 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     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 swift 1.26 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 swift 1.27 <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
111 swift 1.26 You can also run <c>lsmod</c> to see what kernel modules the Installation CD
112 swift 1.34 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 swift 1.1 </p>
117    
118     <p>
119 neysx 1.37 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 josejx 1.40 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 swift 1.1 </p>
126    
127     <pre caption="Invoking menuconfig">
128     # <i>cd /usr/src/linux</i>
129 josejx 1.40 <comment>Substitute defconfig for pmac32_defconfig below if using a 2.6.15 or earlier kernel</comment>
130     # <i>make pmac32_defconfig</i>
131 swift 1.1 # <i>make menuconfig</i>
132     </pre>
133    
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>
139    
140     </body>
141     </subsection>
142     <subsection>
143     <title>Activating Required Options</title>
144     <body>
145    
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>
150    
151 fox2mike 1.28 <pre caption="Selecting experimental code/drivers, General setup">
152 swift 1.1 Code maturity level options ---&gt;
153     [*] Prompt for development and/or incomplete code/drivers
154     </pre>
155    
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 swift 1.19 able to mount your partitions. Also select <c>/proc file system</c> and
160 neysx 1.38 <c>Virtual memory</c>.
161 swift 1.1 </p>
162    
163     <pre caption="Selecting necessary file systems">
164 dertobi123 1.6 File systems ---&gt;
165     Pseudo Filesystems ---&gt;
166     [*] /proc file system support
167     [*] Virtual memory file system support (former shm fs)
168    
169 swift 1.1 <comment>(Select one or more of the following options as needed by your system)</comment>
170 swift 1.34 &lt;*&gt; Second extended fs support
171     &lt;*&gt; Ext3 journalling file system support
172 swift 1.1 &lt;*&gt; Reiserfs support
173     &lt;*&gt; XFS filesystem support
174     </pre>
175    
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>
180    
181     <pre caption="Selecting PPPoE necessary drivers">
182 neysx 1.4 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 swift 1.1 </pre>
188    
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>
194    
195     <p>
196     If you require it, don't forget to include support in the kernel for your
197     ethernet card.
198     </p>
199    
200     <p>
201 swift 1.34 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 swift 1.1 </p>
205    
206     <pre caption="Activating HFS support">
207     File Systems ---&gt;
208     [*] HFS Support
209     </pre>
210    
211     <p>
212 josejx 1.24 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>
216    
217     <pre caption="Ensure the Preemptible Kernel Option is Off">
218     Platform options ---&gt;
219     [ ] Preemptible Kernel
220     </pre>
221    
222     <p>
223 swift 1.34 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>
227    
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>
235    
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>
241    
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>
249    
250     <p>
251 josejx 1.33 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>
256    
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>
268    
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>
275    
276     <p>
277 swift 1.1 When you're done configuring your kernel, continue with <uri
278     link="#compiling">Compiling and Installing</uri>.
279     </p>
280    
281     </body>
282     </subsection>
283     <subsection id="compiling">
284     <title>Compiling and Installing</title>
285     <body>
286    
287     <p>
288     Now that your kernel is configured, it is time to compile and install it. Exit
289 dertobi123 1.6 the configuration and run the commands which will compile the kernel:
290 swift 1.1 </p>
291    
292     <pre caption="Compiling the kernel">
293 swift 1.34 # <i>make &amp;&amp; make modules_install</i>
294 swift 1.1 </pre>
295    
296     <p>
297 neysx 1.10 When the kernel has finished compiling, copy the kernel image to
298 fox2mike 1.39 <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>
301    
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 swift 1.1 </p>
310    
311     <pre caption="Installing the kernel">
312 fox2mike 1.39 # <i>cd /usr/src/linux</i>
313 neysx 1.38 <comment>replace &lt;kernel-version&gt; with your kernel version</comment>
314 fox2mike 1.39 <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 swift 1.1 </pre>
319    
320     <p>
321     Now continue with <uri link="#kernel_modules">Installing Separate Kernel
322     Modules</uri>.
323     </p>
324    
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>
333    
334     <p>
335     You should list the modules you want automatically loaded in
336 pylon 1.7 <path>/etc/modules.autoload.d/kernel-2.6</path>.
337 swift 1.34 You can add extra options to the modules too if needed.
338 swift 1.1 </p>
339    
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>
345    
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>
349    
350     <p>
351     For instance, to automatically load the <c>3c59x.o</c> module, edit the
352 pylon 1.7 <path>kernel-2.6</path> file and enter the module
353 swift 1.1 name in it.
354     </p>
355    
356 dertobi123 1.6 <pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
357     # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
358 swift 1.1 </pre>
359    
360 pylon 1.7 <pre caption="/etc/modules.autoload.d/kernel-2.6">
361 swift 1.1 3c59x
362     </pre>
363    
364     <p>
365 swift 1.19 Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
366     your System</uri>.
367     </p>
368    
369     </body>
370     </subsection>
371     </section>
372     <section id="genkernel">
373     <title>Alternative: Using genkernel</title>
374     <body>
375    
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>
380    
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 swift 1.34 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 swift 1.19 </p>
392    
393     <p>
394     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
395     </p>
396    
397     <pre caption="Emerging genkernel">
398     # <i>emerge genkernel</i>
399     </pre>
400    
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 sejo 1.15 </p>
405 swift 1.19
406     <pre caption="Copying over the Installation CD kernel config">
407 swift 1.21 # <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i>
408 swift 1.19 </pre>
409    
410     <p>
411 swift 1.34 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>
416    
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 swift 1.19 </p>
424    
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 swift 1.34 <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 swift 1.19 </p>
433    
434     <pre caption="Running genkernel">
435 swift 1.34 # <i>genkernel all</i>
436     </pre>
437    
438     <pre caption="Running genkernel on the Pegasos">
439     # <i>genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all</i>
440 sejo 1.15 </pre>
441 swift 1.19
442 sejo 1.17 <p>
443 swift 1.19 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 josejx 1.22 before your "real" system starts up. Be sure to also copy down the required
450 swift 1.34 boot arguments, these are required for a successful boot with genkernel.
451 sejo 1.17 </p>
452 swift 1.19
453     <pre caption="Checking the created kernel image name and initrd">
454 swift 1.35 # <i>ls /boot/kernel* /boot/initramfs*</i>
455 sejo 1.17 </pre>
456 swift 1.19
457 sejo 1.15 <p>
458 swift 1.19 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>
463    
464     <pre caption="Emerging and enabling coldplug">
465     # <i>emerge coldplug</i>
466     # <i>rc-update add coldplug boot</i>
467     </pre>
468    
469     <p>
470     Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>.
471 swift 1.1 </p>
472    
473     </body>
474     </section>
475 swift 1.19
476 swift 1.1 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20