/[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.42 - (hide annotations) (download) (as text)
Wed Aug 30 22:52:28 2006 UTC (7 years, 11 months ago) by nightmorph
Branch: MAIN
Changes since 1.41: +59 -43 lines
File MIME type: application/xml
2006.1 networked docs are in. portage handbook still untouched per separate bugs. thanks to all the hard work, guys. blame me if something is wrong (and please fix quickly) :)

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.42 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-install-ppc-kernel.xml,v 1.26 2006/08/30 21:42:38 josejx Exp $ -->
8 swift 1.1
9     <sections>
10 swift 1.12
11 nightmorph 1.42 <version>7.0</version>
12     <date>2006-08-30</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 nightmorph 1.42 The core around which all distributions are built is the Linux kernel. It is the
42     layer between the user 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 nightmorph 1.42 sources. The <c>USE="-doc"</c> is necessary to avoid installing xorg-x11 or
53 neysx 1.38 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 nightmorph 1.42 <pre caption="Installing a 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 nightmorph 1.42 lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-2.6.15
72 swift 1.1 </pre>
73    
74     <p>
75 nightmorph 1.42 Now it is time to configure and compile your kernel source. You
76     can use <c>genkernel</c> for this, which will build a generic kernel as used
77     by the Installation CD. We explain the "manual" configuration first though, as
78     it is 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     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 nightmorph 1.42 Linux user ever has to perform. Nothing is less true -- after configuring a
100     couple of kernels you don'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     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 nightmorph 1.42 Now, go to your kernel source directory, it's time to configure your kernel.
120     It is recommended that you add the default settings to your configuration by
121     first running <c>make defconfig</c>. After the default configuration has been
122     generated, run <c>make menuconfig</c> which will fire up an ncurses-based
123     configuration menu.
124 swift 1.1 </p>
125    
126     <pre caption="Invoking menuconfig">
127     # <i>cd /usr/src/linux</i>
128 nightmorph 1.42 # <i>make defconfig</i>
129 swift 1.1 # <i>make menuconfig</i>
130     </pre>
131    
132     <p>
133     You will be greeted with several configuration sections. We'll first list some
134     options you must activate (otherwise Gentoo will not function, or not function
135     properly without additional tweaks).
136     </p>
137    
138     </body>
139     </subsection>
140     <subsection>
141     <title>Activating Required Options</title>
142     <body>
143    
144     <p>
145     First of all, activate the use of development and experimental code/drivers.
146     You need this, otherwise some very important code/drivers won't show up:
147     </p>
148    
149 nightmorph 1.42 <pre caption="Selecting experimental code/drivers">
150 swift 1.1 Code maturity level options ---&gt;
151     [*] Prompt for development and/or incomplete code/drivers
152     </pre>
153    
154     <p>
155     Now go to <c>File Systems</c> and select support for the filesystems you use.
156     <e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
157 nightmorph 1.42 able to mount your partitions. Also select the <c>/proc file system</c> and
158     <c>Virtual memory</c>. Make sure that you also enable support for Amiga
159     partitions if you are using a Pegasos, or Macintosh partitions if you are using
160     an Apple computer.
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 nightmorph 1.42 Partition Types ---&gt;
169     [*] Amiga partition table support
170     [*] Macintosh partition map support
171 dertobi123 1.6
172 swift 1.1 <comment>(Select one or more of the following options as needed by your system)</comment>
173 nightmorph 1.42 &lt;*&gt; Reiserfs support
174     &lt;*&gt; Ext3 journalling file system support
175 swift 1.34 &lt;*&gt; Second extended fs support
176 swift 1.1 &lt;*&gt; XFS filesystem support
177     </pre>
178    
179     <p>
180     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     Networking support ---&gt;
187     &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     The two compression options won't harm but are not definitely needed, neither
194     does the <c>PPP over Ethernet</c> option, that might only be used by
195     <c>rp-pppoe</c> when configured to do kernel mode PPPoE.
196     </p>
197    
198     <p>
199     If you require it, don't forget to include support in the kernel for your
200     ethernet card.
201     </p>
202    
203     <p>
204 swift 1.34 Users of NewWorld and OldWorld machines will want HFS support as well. OldWorld
205     users require it for copying compiled kernels to the MacOS partition. NewWorld
206     users require it for configuring the special Apple_Bootstrap partition:
207 swift 1.1 </p>
208    
209     <pre caption="Activating HFS support">
210     File Systems ---&gt;
211     [*] HFS Support
212     </pre>
213    
214     <p>
215 josejx 1.24 At this time, kernel preemption is still unstable on PPC and may cause
216     compilation failures and random segfaults. It is <e>strongly</e> suggested
217     that you do not use this feature.
218     </p>
219    
220     <pre caption="Ensure the Preemptible Kernel Option is Off">
221 nightmorph 1.42 Kernel options ---&gt;
222     Preemption Model (No Forced Preemption (Server))
223 josejx 1.24 </pre>
224    
225     <p>
226 nightmorph 1.42 If you're booting from Firewire, you'll need to enable these options. If you do
227     not want to compile in support, you'll need to include these modules and their
228     dependencies in an initrd.
229 swift 1.34 </p>
230    
231     <pre caption="Enable support for firewire devices on boot">
232     Device Drivers ---&gt;
233     IEEE 1394 (FireWire) support ---&gt;
234     &lt;*&gt; IEEE 1394 (FireWire) support
235     &lt;*&gt; OHCI-1394 support
236     &lt;*&gt; SBP-2 support (Harddisks etc.)
237     </pre>
238    
239     <p>
240     If you're booting from USB, you'll need to enable these options. If you do not
241     want to compile in support, you'll need to include these modules and their
242     dependencies in an initrd.
243     </p>
244    
245     <pre caption="Enable support for USB devices on boot">
246     Device Drivers ---&gt;
247     USB support ---&gt;
248     &lt;*&gt; Support for Host-side USB
249     &lt;*&gt; OHCI HCD support
250     &lt;*&gt; USB Mass Storage support
251     </pre>
252    
253     <p>
254 josejx 1.33 Do not turn off kernel framebuffer support as it is required for a successful
255     boot. If you are using an NVIDIA based chipset, you should use the OpenFirmware
256     framebuffer. If you are using an ATI based chipset, you should select the
257     framebuffer driver based upon your chipset (Mach64, Rage128 or Radeon).
258     </p>
259    
260     <pre caption="Chosing a Framebuffer Driver">
261     Device Drivers ---&gt;
262     Graphics support ---&gt;
263     &lt;*&gt; Support for frame buffer devices
264     [*] Open Firmware frame buffer device support
265     &lt;*&gt; ATI Radeon display support
266     &lt;*&gt; ATI Rage128 display support
267     &lt;*&gt; ATI Mach64 display support
268     Console display driver support ---&gt;
269     &lt;*&gt; Framebuffer Console support
270     </pre>
271    
272     <note>
273     If you select more than one framebuffer device, it may default to a less than
274     optimal driver. Either use only one framebuffer device or specify which
275     to use by passing the driver to use to the kernel on boot such as
276     <c>video=radeonfb</c>.
277     </note>
278    
279     <p>
280 swift 1.1 When you're done configuring your kernel, continue with <uri
281     link="#compiling">Compiling and Installing</uri>.
282     </p>
283    
284     </body>
285     </subsection>
286     <subsection id="compiling">
287     <title>Compiling and Installing</title>
288     <body>
289    
290     <p>
291     Now that your kernel is configured, it is time to compile and install it. Exit
292 dertobi123 1.6 the configuration and run the commands which will compile the kernel:
293 swift 1.1 </p>
294    
295     <pre caption="Compiling the kernel">
296 swift 1.34 # <i>make &amp;&amp; make modules_install</i>
297 swift 1.1 </pre>
298    
299     <p>
300 neysx 1.10 When the kernel has finished compiling, copy the kernel image to
301 fox2mike 1.39 <path>/boot</path> (be sure that it is mounted properly on Pegasos computers).
302     If you are using BootX to boot, we'll copy the kernel later.
303     </p>
304    
305     <p>
306     Yaboot and BootX expect to use an uncompressed kernel unlike many other
307     bootloaders. The uncompressed kernel is called vmlinux and it is placed in
308     <path>/usr/src/linux</path> after the kernel has finished compiling. If you
309     are using a Pegasos machine, the Pegasos firmware requires a compressed
310     kernel called zImage.chrp which can be found in
311     <path>/usr/src/linux/arch/ppc/boot/images</path>.
312 swift 1.1 </p>
313    
314     <pre caption="Installing the kernel">
315 fox2mike 1.39 # <i>cd /usr/src/linux</i>
316 neysx 1.38 <comment>replace &lt;kernel-version&gt; with your kernel version</comment>
317 fox2mike 1.39 <comment>(Apple/IBM)</comment>
318     # <i>cp vmlinux /boot/&lt;kernel-version&gt;</i>
319     <comment>(Pegasos)</comment>
320     # <i>cp arch/ppc/boot/images/zImage.chrp /boot/&lt;kernel-version&gt;</i>
321 swift 1.1 </pre>
322    
323     <p>
324     Now continue with <uri link="#kernel_modules">Installing Separate Kernel
325     Modules</uri>.
326     </p>
327    
328     </body>
329     </subsection>
330     </section>
331     <section id="kernel_modules">
332     <title>Installing Separate Kernel Modules</title>
333     <subsection>
334     <title>Configuring the Modules</title>
335     <body>
336    
337     <p>
338     You should list the modules you want automatically loaded in
339 pylon 1.7 <path>/etc/modules.autoload.d/kernel-2.6</path>.
340 nightmorph 1.42 You can add extra options to the modules too if you want.
341 swift 1.1 </p>
342    
343     <p>
344     To view all available modules, run the following <c>find</c> command. Don't
345     forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
346     just compiled:
347     </p>
348    
349     <pre caption="Viewing all available modules">
350     # <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
351     </pre>
352    
353     <p>
354     For instance, to automatically load the <c>3c59x.o</c> module, edit the
355 pylon 1.7 <path>kernel-2.6</path> file and enter the module
356 swift 1.1 name in it.
357     </p>
358    
359 dertobi123 1.6 <pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
360     # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
361 swift 1.1 </pre>
362    
363 pylon 1.7 <pre caption="/etc/modules.autoload.d/kernel-2.6">
364 swift 1.1 3c59x
365     </pre>
366    
367     <p>
368 swift 1.19 Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
369     your System</uri>.
370     </p>
371    
372     </body>
373     </subsection>
374     </section>
375     <section id="genkernel">
376     <title>Alternative: Using genkernel</title>
377     <body>
378    
379     <p>
380     If you are reading this section, you have chosen to use our <c>genkernel</c>
381     script to configure your kernel for you.
382     </p>
383    
384     <p>
385     Now that your kernel source tree is installed, it's now time to compile your
386     kernel by using our <c>genkernel</c> script to automatically build a kernel for
387     you. <c>genkernel</c> works by configuring a kernel nearly identically to the
388     way our Installation CD kernel is configured. This means that when you use
389     <c>genkernel</c> to build your kernel, your system will generally detect all
390 nightmorph 1.42 your hardware at boot-time, just like our Installation CD does. Because genkernel
391     doesn't require any manual kernel configuration, it is an ideal solution for
392     those users who may not be comfortable compiling their own kernels.
393 swift 1.19 </p>
394    
395     <p>
396     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
397     </p>
398    
399     <pre caption="Emerging genkernel">
400     # <i>emerge genkernel</i>
401     </pre>
402    
403     <p>
404     Next, copy over the kernel configuration used by the Installation CD to the
405     location where genkernel looks for the default kernel configuration:
406 sejo 1.15 </p>
407 swift 1.19
408     <pre caption="Copying over the Installation CD kernel config">
409 swift 1.21 # <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i>
410 swift 1.19 </pre>
411    
412     <p>
413 swift 1.34 If you are using firewire or USB to boot, you'll need to add modules to the
414     initrd. Edit <path>/usr/share/genkernel/ppc/modules_load</path> and change
415     <c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for firewire support or
416     <c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support.
417     </p>
418    
419 nightmorph 1.42
420 swift 1.34 <p>
421     Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
422     For Pegasos, we will need to use a different config and create a zImage instead
423     of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c>
424     compiles a kernel that supports almost all hardware, this compilation can take
425     quite a while to finish!
426 swift 1.19 </p>
427    
428     <p>
429     Note that, if your partition where the kernel should be located doesn't use ext2
430     or ext3 as filesystem you might need to manually configure your kernel using
431 nightmorph 1.42 <c>genkernel --menuconfig all</c> and add support for your
432 swift 1.34 filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or
433     LVM2 will probably want to add <c>--evms2</c> or <c>--lvm2</c> as argument as
434     well.
435 swift 1.19 </p>
436    
437     <pre caption="Running genkernel">
438 swift 1.34 # <i>genkernel all</i>
439     </pre>
440    
441     <pre caption="Running genkernel on the Pegasos">
442     # <i>genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all</i>
443 sejo 1.15 </pre>
444 swift 1.19
445 sejo 1.17 <p>
446 swift 1.19 Once <c>genkernel</c> completes, a kernel, full set of modules and
447     <e>initial root disk</e> (initrd) will be created. We will use the kernel
448     and initrd when configuring a boot loader later in this document. Write
449     down the names of the kernel and initrd as you will need it when writing
450     the bootloader configuration file. The initrd will be started immediately after
451     booting to perform hardware autodetection (just like on the Installation CD)
452 josejx 1.22 before your "real" system starts up. Be sure to also copy down the required
453 swift 1.34 boot arguments, these are required for a successful boot with genkernel.
454 sejo 1.17 </p>
455 swift 1.19
456     <pre caption="Checking the created kernel image name and initrd">
457 swift 1.35 # <i>ls /boot/kernel* /boot/initramfs*</i>
458 sejo 1.17 </pre>
459 swift 1.19
460 sejo 1.15 <p>
461 nightmorph 1.42 If you want your system to be more like the Installation CD you should,
462     when your Gentoo installation is over, emerge <c>coldplug</c>. While the
463     initrd autodetects hardware that is needed to boot your system,
464     <c>coldplug</c> autodetects everything else. <c>coldplug</c> is available as one
465     of the packages on the Package CD.
466 swift 1.19 </p>
467    
468     <pre caption="Emerging and enabling coldplug">
469 nightmorph 1.42 <comment>(Do this after the installation, during the GRP installation instructions)</comment>
470     # <i>emerge -k coldplug</i>
471 swift 1.19 # <i>rc-update add coldplug boot</i>
472     </pre>
473    
474     <p>
475 nightmorph 1.42 If you want your system to react to hotplugging events, you will need to install
476     and setup <c>hotplug</c> as well:
477     </p>
478    
479     <pre caption="Emerging and enabling hotplug">
480     # <i>emerge hotplug</i>
481     # <i>rc-update add hotplug default</i>
482     </pre>
483    
484     <p>
485 swift 1.19 Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>.
486 swift 1.1 </p>
487    
488     </body>
489     </section>
490 swift 1.19
491 swift 1.1 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20