/[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.38 - (hide annotations) (download) (as text)
Sun Jan 8 14:05:29 2006 UTC (8 years, 8 months ago) by neysx
Branch: MAIN
Changes since 1.37: +23 -40 lines
File MIME type: application/xml
#118031 hb-install-*-kernel.xml files need TLC

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 neysx 1.38 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml,v 1.37 2005/11/21 15:37:12 neysx Exp $ -->
8 swift 1.1
9     <sections>
10 swift 1.12
11 neysx 1.38 <version>2.15</version>
12     <date>2006-01-06</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 neysx 1.38 <!-- Removed, as we're trying to avoid specific kernel versions to improve HB
63     maintainability
64 swift 1.19 <note>
65 neysx 1.38 The suggested sources at the time of the 2005.1 release are
66 swift 1.34 <c>gentoo-sources-2.6.12-r4</c> and <c>vanilla-sources-2.6.12.2</c>.
67 neysx 1.38 </note>
68     -->
69 swift 1.19
70 swift 1.1 <p>
71 swift 1.34 If you take a look in <path>/usr/src</path> you should see a symlink named
72 neysx 1.38 <path>linux</path> pointing to your current kernel source. In this case, the
73     installed kernel source points to <c>gentoo-sources-2.6.12-r4</c>. Your version
74     may be different, so keep this in mind.
75 swift 1.1 </p>
76    
77     <pre caption="Viewing the kernel source symlink">
78     # <i>ls -l /usr/src/linux</i>
79 swift 1.34 lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-2.6.12-gentoo-r4
80 swift 1.1 </pre>
81    
82     <p>
83 swift 1.34 It is now time to configure and compile your kernel source. You can use
84     <c>genkernel</c> to build a generic kernel similar to the one used by the
85     Installation CD, or you can perform a manual configuration to best suit your
86     system.
87 swift 1.1 </p>
88    
89     <p>
90 swift 1.19 If you want to manually configure your kernel, continue now with <uri
91     link="#manual">Default: Manual Configuration</uri>. If you want to use
92     <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
93     genkernel</uri> instead.
94 swift 1.1 </p>
95    
96     </body>
97     </subsection>
98     </section>
99     <section id="manual">
100 swift 1.19 <title>Default: Manual Configuration</title>
101 swift 1.1 <subsection>
102     <title>Introduction</title>
103     <body>
104    
105     <p>
106 neysx 1.10 Manually configuring a kernel is often seen as the most difficult procedure a
107 swift 1.34 Linux user ever has to perform. Nothing is less true, after configuring a
108     couple of kernels you won't even remember it being that difficult ;)
109 swift 1.1 </p>
110    
111     <p>
112 neysx 1.37 However, one thing <e>is</e> true: you must know your system when you start
113     configuring a kernel manually. Most information can be gathered by emerging
114     pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
115 swift 1.26 be able to use <c>lspci</c> within the chrooted environment. You may safely
116     ignore any <e>pcilib</e> warnings (like pcilib: cannot open
117     /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
118 swift 1.27 <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
119 swift 1.26 You can also run <c>lsmod</c> to see what kernel modules the Installation CD
120 swift 1.34 uses (it might provide you with a nice hint on what to enable). Another place
121     to look for clues as to what components to enable is to check the kernel
122     message logs from the successful boot that got you this far. Type <c>dmesg</c>
123     to see the kernel messages.
124 swift 1.1 </p>
125    
126     <p>
127 neysx 1.37 Now go to your kernel source directory, it's time to configure your kernel. It
128     is recommended that you add the default settings to your configuration by first
129     running <c>make defconfig</c>. After the default configuration has been
130     generated, run <c>make menuconfig</c> which will fire up an ncurses-based
131     configuration menu.
132 swift 1.1 </p>
133    
134     <pre caption="Invoking menuconfig">
135     # <i>cd /usr/src/linux</i>
136 neysx 1.37 # <i>make defconfig</i>
137 swift 1.1 # <i>make menuconfig</i>
138     </pre>
139    
140     <p>
141     You will be greeted with several configuration sections. We'll first list some
142     options you must activate (otherwise Gentoo will not function, or not function
143     properly without additional tweaks).
144     </p>
145    
146     </body>
147     </subsection>
148     <subsection>
149     <title>Activating Required Options</title>
150     <body>
151    
152     <p>
153     First of all, activate the use of development and experimental code/drivers.
154     You need this, otherwise some very important code/drivers won't show up:
155     </p>
156    
157 fox2mike 1.28 <pre caption="Selecting experimental code/drivers, General setup">
158 swift 1.1 Code maturity level options ---&gt;
159     [*] Prompt for development and/or incomplete code/drivers
160 fox2mike 1.28 General setup --->
161     [*] Support for hot-pluggable devices
162 swift 1.1 </pre>
163    
164     <p>
165     Now go to <c>File Systems</c> and select support for the filesystems you use.
166     <e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
167 swift 1.19 able to mount your partitions. Also select <c>/proc file system</c> and
168 neysx 1.38 <c>Virtual memory</c>.
169 swift 1.1 </p>
170    
171     <pre caption="Selecting necessary file systems">
172 dertobi123 1.6 File systems ---&gt;
173     Pseudo Filesystems ---&gt;
174     [*] /proc file system support
175     [*] Virtual memory file system support (former shm fs)
176    
177 swift 1.1 <comment>(Select one or more of the following options as needed by your system)</comment>
178 swift 1.34 &lt;*&gt; Second extended fs support
179     &lt;*&gt; Ext3 journalling file system support
180 swift 1.1 &lt;*&gt; Reiserfs support
181     &lt;*&gt; XFS filesystem support
182     </pre>
183    
184     <p>
185     If you are using PPPoE to connect to the Internet or you are using a dial-up
186     modem, you will need the following options in the kernel:
187     </p>
188    
189     <pre caption="Selecting PPPoE necessary drivers">
190 neysx 1.4 Device Drivers ---&gt;
191     Networking support ---&gt;
192     &lt;*&gt; PPP (point-to-point protocol) support
193     &lt;*&gt; PPP support for async serial ports
194     &lt;*&gt; PPP support for sync tty ports
195 swift 1.1 </pre>
196    
197     <p>
198     The two compression options won't harm but are not definitely needed, neither
199     does the <c>PPP over Ethernet</c> option, that might only be used by
200     <c>rp-pppoe</c> when configured to do kernel mode PPPoE.
201     </p>
202    
203     <p>
204     If you require it, don't forget to include support in the kernel for your
205     ethernet card.
206     </p>
207    
208     <p>
209 swift 1.34 Users of NewWorld and OldWorld machines will want HFS support as well. OldWorld
210     users require it for copying compiled kernels to the MacOS partition. NewWorld
211     users require it for configuring the special Apple_Bootstrap partition:
212 swift 1.1 </p>
213    
214     <pre caption="Activating HFS support">
215     File Systems ---&gt;
216     [*] HFS Support
217     </pre>
218    
219     <p>
220 josejx 1.24 At this time, kernel preemption is still unstable on PPC and may cause
221     compilation failures and random segfaults. It is <e>strongly</e> suggested
222     that you do not use this feature.
223     </p>
224    
225     <pre caption="Ensure the Preemptible Kernel Option is Off">
226     Platform options ---&gt;
227     [ ] Preemptible Kernel
228     </pre>
229    
230     <p>
231 swift 1.34 If you're booting from Firewire, you'll need to enable these options. If you
232     do not want to compile in support, you'll need to include these modules and
233     their dependencies in an initrd.
234     </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     boot. If you are using an NVIDIA based chipset, you should use the OpenFirmware
261     framebuffer. If you are using an ATI based chipset, you should select the
262     framebuffer driver based upon your chipset (Mach64, Rage128 or Radeon).
263     </p>
264    
265     <pre caption="Chosing a Framebuffer Driver">
266     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     to use by passing the driver to use to the kernel on boot such as
281     <c>video=radeonfb</c>.
282     </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     Now that your kernel is configured, it is time to compile and install it. Exit
297 dertobi123 1.6 the configuration and run the commands which will compile the kernel:
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 swift 1.19 <path>/boot</path> (be sure that it is mounted properly on the Pegasos).
307 swift 1.1 </p>
308    
309     <pre caption="Installing the kernel">
310 neysx 1.38 <comment>replace &lt;kernel-version&gt; with your kernel version</comment>
311     (Apple/IBM) # <i>cp vmlinux /boot/&lt;kernel-version&gt;</i>
312     (Pegasos) # <i>cp arch/ppc/boot/images/zImage.chrp /boot/&lt;kernel-version&gt;</i>
313 swift 1.1 </pre>
314    
315     <p>
316     Now continue with <uri link="#kernel_modules">Installing Separate Kernel
317     Modules</uri>.
318     </p>
319    
320     </body>
321     </subsection>
322     </section>
323     <section id="kernel_modules">
324     <title>Installing Separate Kernel Modules</title>
325     <subsection>
326     <title>Configuring the Modules</title>
327     <body>
328    
329     <p>
330     You should list the modules you want automatically loaded in
331 pylon 1.7 <path>/etc/modules.autoload.d/kernel-2.6</path>.
332 swift 1.34 You can add extra options to the modules too if needed.
333 swift 1.1 </p>
334    
335     <p>
336     To view all available modules, run the following <c>find</c> command. Don't
337     forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
338     just compiled:
339     </p>
340    
341     <pre caption="Viewing all available modules">
342     # <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
343     </pre>
344    
345     <p>
346     For instance, to automatically load the <c>3c59x.o</c> module, edit the
347 pylon 1.7 <path>kernel-2.6</path> file and enter the module
348 swift 1.1 name in it.
349     </p>
350    
351 dertobi123 1.6 <pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
352     # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
353 swift 1.1 </pre>
354    
355 pylon 1.7 <pre caption="/etc/modules.autoload.d/kernel-2.6">
356 swift 1.1 3c59x
357     </pre>
358    
359     <p>
360 swift 1.19 Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
361     your System</uri>.
362     </p>
363    
364     </body>
365     </subsection>
366     </section>
367     <section id="genkernel">
368     <title>Alternative: Using genkernel</title>
369     <body>
370    
371     <p>
372     If you are reading this section, you have chosen to use our <c>genkernel</c>
373     script to configure your kernel for you.
374     </p>
375    
376     <p>
377     Now that your kernel source tree is installed, it's now time to compile your
378     kernel by using our <c>genkernel</c> script to automatically build a kernel for
379     you. <c>genkernel</c> works by configuring a kernel nearly identically to the
380     way our Installation CD kernel is configured. This means that when you use
381     <c>genkernel</c> to build your kernel, your system will generally detect all
382 swift 1.34 your hardware at boot-time, just like our Installation CD does.
383     Because genkernel doesn't require any manual kernel configuration, it is an
384     ideal solution for those users who may not be comfortable compiling their own
385     kernels.
386 swift 1.19 </p>
387    
388     <p>
389     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
390     </p>
391    
392     <pre caption="Emerging genkernel">
393     # <i>emerge genkernel</i>
394     </pre>
395    
396     <p>
397     Next, copy over the kernel configuration used by the Installation CD to the
398     location where genkernel looks for the default kernel configuration:
399 sejo 1.15 </p>
400 swift 1.19
401     <pre caption="Copying over the Installation CD kernel config">
402 swift 1.21 # <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i>
403 swift 1.19 </pre>
404    
405     <p>
406 swift 1.34 If you are using firewire or USB to boot, you'll need to add modules to the
407     initrd. Edit <path>/usr/share/genkernel/ppc/modules_load</path> and change
408     <c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for firewire support or
409     <c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support.
410     </p>
411    
412     <p>
413     Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
414     For Pegasos, we will need to use a different config and create a zImage instead
415     of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c>
416     compiles a kernel that supports almost all hardware, this compilation can take
417     quite a while to finish!
418 swift 1.19 </p>
419    
420     <p>
421     Note that, if your partition where the kernel should be located doesn't use ext2
422     or ext3 as filesystem you might need to manually configure your kernel using
423 swift 1.34 <c>genkernel --menuconfig --genzimage all</c> and add support for your
424     filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or
425     LVM2 will probably want to add <c>--evms2</c> or <c>--lvm2</c> as argument as
426     well.
427 swift 1.19 </p>
428    
429     <pre caption="Running genkernel">
430 swift 1.34 # <i>genkernel all</i>
431     </pre>
432    
433     <pre caption="Running genkernel on the Pegasos">
434     # <i>genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all</i>
435 sejo 1.15 </pre>
436 swift 1.19
437 sejo 1.17 <p>
438 swift 1.19 Once <c>genkernel</c> completes, a kernel, full set of modules and
439     <e>initial root disk</e> (initrd) will be created. We will use the kernel
440     and initrd when configuring a boot loader later in this document. Write
441     down the names of the kernel and initrd as you will need it when writing
442     the bootloader configuration file. The initrd will be started immediately after
443     booting to perform hardware autodetection (just like on the Installation CD)
444 josejx 1.22 before your "real" system starts up. Be sure to also copy down the required
445 swift 1.34 boot arguments, these are required for a successful boot with genkernel.
446 sejo 1.17 </p>
447 swift 1.19
448     <pre caption="Checking the created kernel image name and initrd">
449 swift 1.35 # <i>ls /boot/kernel* /boot/initramfs*</i>
450 sejo 1.17 </pre>
451 swift 1.19
452 sejo 1.15 <p>
453 swift 1.19 Now, let's perform one more step to get our system to be more like the
454     Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects
455     hardware that is needed to boot your system, <c>coldplug</c> autodetects
456     everything else. To emerge and enable <c>coldplug</c>, type the following:
457     </p>
458    
459     <pre caption="Emerging and enabling coldplug">
460     # <i>emerge coldplug</i>
461     # <i>rc-update add coldplug boot</i>
462     </pre>
463    
464     <p>
465     Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>.
466 swift 1.1 </p>
467    
468     </body>
469     </section>
470 swift 1.19
471 swift 1.1 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20