/[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.35 - (hide annotations) (download) (as text)
Fri Aug 12 08:51:50 2005 UTC (9 years, 1 month ago) by swift
Branch: MAIN
Changes since 1.34: +4 -4 lines
File MIME type: application/xml
Fix location of genkernels initramfs file. Reported on the forums, not caught by release checking

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     <!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
6    
7 swift 1.35 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml,v 1.34 2005/08/09 09:43:58 swift Exp $ -->
8 swift 1.1
9     <sections>
10 swift 1.12
11 swift 1.35 <version>2.12</version>
12     <date>2005-08-12</date>
13 swift 1.12
14 swift 1.1 <section>
15     <title>Timezone</title>
16     <body>
17    
18     <p>
19 swift 1.34 First, select your timezone so that your system knows where it is located. Look
20     for your timezone in <path>/usr/share/zoneinfo</path>, then make a symlink to
21     <path>/etc/localtime</path> using <c>ln</c>:
22 swift 1.1 </p>
23    
24     <pre caption="Setting the timezone information">
25     # <i>ls /usr/share/zoneinfo</i>
26     <comment>(Suppose you want to use GMT)</comment>
27     # <i>ln -sf /usr/share/zoneinfo/GMT /etc/localtime</i>
28     </pre>
29    
30     </body>
31     </section>
32     <section>
33     <title>Installing the Sources</title>
34     <subsection>
35     <title>Choosing a Kernel</title>
36     <body>
37    
38     <p>
39 swift 1.34 The base that all distributions are built upon is the Linux kernel. It is the
40     layer between the your programs and your system hardware. Gentoo provides its
41 swift 1.1 users several possible kernel sources. A full listing with description is
42     available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
43     Guide</uri>.
44     </p>
45    
46     <p>
47 swift 1.34 We suggest using either <c>vanilla-sources</c> or <c>gentoo-sources</c>
48     on PPC, which are both 2.6 kernels. The latter is available when you
49     perform a networkless installation. So let's continue with <c>emerge</c>'ing
50     the kernel sources:
51 swift 1.1 </p>
52    
53 swift 1.34 <pre caption="Installing the kernel source">
54 swift 1.19 # <i>emerge gentoo-sources</i>
55 swift 1.1 </pre>
56    
57 swift 1.19 <note>
58 swift 1.34 The suggested sources at the time of the 2005.1 release are
59     <c>gentoo-sources-2.6.12-r4</c> and <c>vanilla-sources-2.6.12.2</c>.
60 swift 1.19 </note>
61    
62 swift 1.1 <p>
63 swift 1.34 If you take a look in <path>/usr/src</path> you should see a symlink named
64     <path>linux</path> pointing to your current kernel source. Here, we will assume
65     that the kernel source installed is <c>gentoo-sources-2.6.12-r4</c>:
66 swift 1.1 </p>
67    
68     <pre caption="Viewing the kernel source symlink">
69     # <i>ls -l /usr/src/linux</i>
70 swift 1.34 lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-2.6.12-gentoo-r4
71 swift 1.1 </pre>
72    
73     <p>
74 swift 1.19 If the symlink doesn't point to the kernel source of your choice (note that
75 swift 1.34 <c>linux-2.6.12-gentoo-r4</c> is merely an example) you should change it to the
76     desired kernel sources:
77 swift 1.1 </p>
78    
79     <pre caption="Changing the kernel source symlink">
80 swift 1.3 # <i>rm /usr/src/linux</i>
81     # <i>cd /usr/src</i>
82 swift 1.34 # <i>ln -s linux-2.6.12-gentoo-r4 linux</i>
83 swift 1.1 </pre>
84    
85     <p>
86 swift 1.34 It is now time to configure and compile your kernel source. You can use
87     <c>genkernel</c> to build a generic kernel similar to the one used by the
88     Installation CD, or you can perform a manual configuration to best suit your
89     system.
90 swift 1.1 </p>
91    
92     <p>
93 swift 1.19 If you want to manually configure your kernel, continue now with <uri
94     link="#manual">Default: Manual Configuration</uri>. If you want to use
95     <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
96     genkernel</uri> instead.
97 swift 1.1 </p>
98    
99     </body>
100     </subsection>
101     </section>
102     <section id="manual">
103 swift 1.19 <title>Default: Manual Configuration</title>
104 swift 1.1 <subsection>
105     <title>Introduction</title>
106     <body>
107    
108     <p>
109 neysx 1.10 Manually configuring a kernel is often seen as the most difficult procedure a
110 swift 1.34 Linux user ever has to perform. Nothing is less true, after configuring a
111     couple of kernels you won't even remember it being that difficult ;)
112 swift 1.1 </p>
113    
114     <p>
115 swift 1.34 Building a successful you must know what is in your system when
116     you start configuring a kernel manually. Most information can be gathered by
117     emerging pciutils <c>emerge pciutils</c> which contains <c>lspci</c>. You
118     can
119 swift 1.26 be able to use <c>lspci</c> within the chrooted environment. You may safely
120     ignore any <e>pcilib</e> warnings (like pcilib: cannot open
121     /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
122 swift 1.27 <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
123 swift 1.26 You can also run <c>lsmod</c> to see what kernel modules the Installation CD
124 swift 1.34 uses (it might provide you with a nice hint on what to enable). Another place
125     to look for clues as to what components to enable is to check the kernel
126     message logs from the successful boot that got you this far. Type <c>dmesg</c>
127     to see the kernel messages.
128 swift 1.1 </p>
129    
130     <p>
131     Now go to your kernel source directory and execute <c>make menuconfig</c>. This
132     will fire up an ncurses-based configuration menu.
133     </p>
134    
135     <pre caption="Invoking menuconfig">
136     # <i>cd /usr/src/linux</i>
137     # <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     <c>Virtual memory</c>. Do <e>not</e> select the <c>/dev file system</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 sejo 1.15 [ ] /dev file system support (OBSOLETE)
176 dertobi123 1.6 [*] Virtual memory file system support (former shm fs)
177    
178 swift 1.1 <comment>(Select one or more of the following options as needed by your system)</comment>
179 swift 1.34 &lt;*&gt; Second extended fs support
180     &lt;*&gt; Ext3 journalling file system support
181 swift 1.1 &lt;*&gt; Reiserfs support
182     &lt;*&gt; XFS filesystem support
183     </pre>
184    
185     <p>
186     If you are using PPPoE to connect to the Internet or you are using a dial-up
187     modem, you will need the following options in the kernel:
188     </p>
189    
190     <pre caption="Selecting PPPoE necessary drivers">
191 neysx 1.4 Device Drivers ---&gt;
192     Networking support ---&gt;
193     &lt;*&gt; PPP (point-to-point protocol) support
194     &lt;*&gt; PPP support for async serial ports
195     &lt;*&gt; PPP support for sync tty ports
196 swift 1.1 </pre>
197    
198     <p>
199     The two compression options won't harm but are not definitely needed, neither
200     does the <c>PPP over Ethernet</c> option, that might only be used by
201     <c>rp-pppoe</c> when configured to do kernel mode PPPoE.
202     </p>
203    
204     <p>
205     If you require it, don't forget to include support in the kernel for your
206     ethernet card.
207     </p>
208    
209     <p>
210 swift 1.34 Users of NewWorld and OldWorld machines will want HFS support as well. OldWorld
211     users require it for copying compiled kernels to the MacOS partition. NewWorld
212     users require it for configuring the special Apple_Bootstrap partition:
213 swift 1.1 </p>
214    
215     <pre caption="Activating HFS support">
216     File Systems ---&gt;
217     [*] HFS Support
218     </pre>
219    
220     <p>
221 josejx 1.24 At this time, kernel preemption is still unstable on PPC and may cause
222     compilation failures and random segfaults. It is <e>strongly</e> suggested
223     that you do not use this feature.
224     </p>
225    
226     <pre caption="Ensure the Preemptible Kernel Option is Off">
227     Platform options ---&gt;
228     [ ] Preemptible Kernel
229     </pre>
230    
231     <p>
232 swift 1.34 If you're booting from Firewire, you'll need to enable these options. If you
233     do not want to compile in support, you'll need to include these modules and
234     their dependencies in an initrd.
235     </p>
236    
237     <pre caption="Enable support for firewire devices on boot">
238     Device Drivers ---&gt;
239     IEEE 1394 (FireWire) support ---&gt;
240     &lt;*&gt; IEEE 1394 (FireWire) support
241     &lt;*&gt; OHCI-1394 support
242     &lt;*&gt; SBP-2 support (Harddisks etc.)
243     </pre>
244    
245     <p>
246     If you're booting from USB, you'll need to enable these options. If you do not
247     want to compile in support, you'll need to include these modules and their
248     dependencies in an initrd.
249     </p>
250    
251     <pre caption="Enable support for USB devices on boot">
252     Device Drivers ---&gt;
253     USB support ---&gt;
254     &lt;*&gt; Support for Host-side USB
255     &lt;*&gt; OHCI HCD support
256     &lt;*&gt; USB Mass Storage support
257     </pre>
258    
259     <p>
260 josejx 1.33 Do not turn off kernel framebuffer support as it is required for a successful
261     boot. If you are using an NVIDIA based chipset, you should use the OpenFirmware
262     framebuffer. If you are using an ATI based chipset, you should select the
263     framebuffer driver based upon your chipset (Mach64, Rage128 or Radeon).
264     </p>
265    
266     <pre caption="Chosing a Framebuffer Driver">
267     Device Drivers ---&gt;
268     Graphics support ---&gt;
269     &lt;*&gt; Support for frame buffer devices
270     [*] Open Firmware frame buffer device support
271     &lt;*&gt; ATI Radeon display support
272     &lt;*&gt; ATI Rage128 display support
273     &lt;*&gt; ATI Mach64 display support
274     Console display driver support ---&gt;
275     &lt;*&gt; Framebuffer Console support
276     </pre>
277    
278     <note>
279     If you select more than one framebuffer device, it may default to a less than
280     optimal driver. Either use only one framebuffer device or specify which
281     to use by passing the driver to use to the kernel on boot such as
282     <c>video=radeonfb</c>.
283     </note>
284    
285     <p>
286 swift 1.1 When you're done configuring your kernel, continue with <uri
287     link="#compiling">Compiling and Installing</uri>.
288     </p>
289    
290     </body>
291     </subsection>
292     <subsection id="compiling">
293     <title>Compiling and Installing</title>
294     <body>
295    
296     <p>
297     Now that your kernel is configured, it is time to compile and install it. Exit
298 dertobi123 1.6 the configuration and run the commands which will compile the kernel:
299 swift 1.1 </p>
300    
301     <pre caption="Compiling the kernel">
302 swift 1.34 # <i>make &amp;&amp; make modules_install</i>
303 swift 1.1 </pre>
304    
305     <p>
306 neysx 1.10 When the kernel has finished compiling, copy the kernel image to
307 swift 1.19 <path>/boot</path> (be sure that it is mounted properly on the Pegasos).
308 swift 1.1 </p>
309    
310     <pre caption="Installing the kernel">
311 swift 1.34 <comment>replace 2.6.12 with your kernel-version</comment>
312     (Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.12</i>
313     (Pegasos) # <i>cp arch/ppc/boot/images/zImage.chrp /boot/kernel-2.6.12</i>
314 swift 1.1 </pre>
315    
316     <p>
317     It is also wise to copy over your kernel configuration file to
318     <path>/boot</path>, just in case :)
319     </p>
320    
321     <pre caption="Backing up your kernel configuration">
322 swift 1.34 # <i>cp .config /boot/config-2.6.12-gentoo-r4</i>
323 swift 1.1 </pre>
324    
325     <p>
326     Now continue with <uri link="#kernel_modules">Installing Separate Kernel
327     Modules</uri>.
328     </p>
329    
330     </body>
331     </subsection>
332     </section>
333     <section id="kernel_modules">
334     <title>Installing Separate Kernel Modules</title>
335     <subsection>
336     <title>Configuring the Modules</title>
337     <body>
338    
339     <p>
340     You should list the modules you want automatically loaded in
341 pylon 1.7 <path>/etc/modules.autoload.d/kernel-2.6</path>.
342 swift 1.34 You can add extra options to the modules too if needed.
343 swift 1.1 </p>
344    
345     <p>
346     To view all available modules, run the following <c>find</c> command. Don't
347     forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
348     just compiled:
349     </p>
350    
351     <pre caption="Viewing all available modules">
352     # <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
353     </pre>
354    
355     <p>
356     For instance, to automatically load the <c>3c59x.o</c> module, edit the
357 pylon 1.7 <path>kernel-2.6</path> file and enter the module
358 swift 1.1 name in it.
359     </p>
360    
361 dertobi123 1.6 <pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
362     # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
363 swift 1.1 </pre>
364    
365 pylon 1.7 <pre caption="/etc/modules.autoload.d/kernel-2.6">
366 swift 1.1 3c59x
367     </pre>
368    
369     <p>
370 swift 1.19 Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
371     your System</uri>.
372     </p>
373    
374     </body>
375     </subsection>
376     </section>
377     <section id="genkernel">
378     <title>Alternative: Using genkernel</title>
379     <body>
380    
381     <p>
382     If you are reading this section, you have chosen to use our <c>genkernel</c>
383     script to configure your kernel for you.
384     </p>
385    
386     <p>
387     Now that your kernel source tree is installed, it's now time to compile your
388     kernel by using our <c>genkernel</c> script to automatically build a kernel for
389     you. <c>genkernel</c> works by configuring a kernel nearly identically to the
390     way our Installation CD kernel is configured. This means that when you use
391     <c>genkernel</c> to build your kernel, your system will generally detect all
392 swift 1.34 your hardware at boot-time, just like our Installation CD does.
393     Because genkernel doesn't require any manual kernel configuration, it is an
394     ideal solution for those users who may not be comfortable compiling their own
395     kernels.
396 swift 1.19 </p>
397    
398     <p>
399     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
400     </p>
401    
402     <pre caption="Emerging genkernel">
403     # <i>emerge genkernel</i>
404     </pre>
405    
406     <p>
407     Next, copy over the kernel configuration used by the Installation CD to the
408     location where genkernel looks for the default kernel configuration:
409 sejo 1.15 </p>
410 swift 1.19
411     <pre caption="Copying over the Installation CD kernel config">
412 swift 1.21 # <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i>
413 swift 1.19 </pre>
414    
415     <p>
416 swift 1.34 If you are using firewire or USB to boot, you'll need to add modules to the
417     initrd. Edit <path>/usr/share/genkernel/ppc/modules_load</path> and change
418     <c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for firewire support or
419     <c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support.
420     </p>
421    
422     <p>
423     Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
424     For Pegasos, we will need to use a different config and create a zImage instead
425     of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c>
426     compiles a kernel that supports almost all hardware, this compilation can take
427     quite a while to finish!
428 swift 1.19 </p>
429    
430     <p>
431     Note that, if your partition where the kernel should be located doesn't use ext2
432     or ext3 as filesystem you might need to manually configure your kernel using
433 swift 1.34 <c>genkernel --menuconfig --genzimage all</c> and add support for your
434     filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or
435     LVM2 will probably want to add <c>--evms2</c> or <c>--lvm2</c> as argument as
436     well.
437 swift 1.19 </p>
438    
439     <pre caption="Running genkernel">
440 swift 1.34 # <i>genkernel all</i>
441     </pre>
442    
443     <pre caption="Running genkernel on the Pegasos">
444     # <i>genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all</i>
445 sejo 1.15 </pre>
446 swift 1.19
447 sejo 1.17 <p>
448 swift 1.19 Once <c>genkernel</c> completes, a kernel, full set of modules and
449     <e>initial root disk</e> (initrd) will be created. We will use the kernel
450     and initrd when configuring a boot loader later in this document. Write
451     down the names of the kernel and initrd as you will need it when writing
452     the bootloader configuration file. The initrd will be started immediately after
453     booting to perform hardware autodetection (just like on the Installation CD)
454 josejx 1.22 before your "real" system starts up. Be sure to also copy down the required
455 swift 1.34 boot arguments, these are required for a successful boot with genkernel.
456 sejo 1.17 </p>
457 swift 1.19
458     <pre caption="Checking the created kernel image name and initrd">
459 swift 1.35 # <i>ls /boot/kernel* /boot/initramfs*</i>
460 sejo 1.17 </pre>
461 swift 1.19
462 sejo 1.15 <p>
463 swift 1.19 Now, let's perform one more step to get our system to be more like the
464     Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects
465     hardware that is needed to boot your system, <c>coldplug</c> autodetects
466     everything else. To emerge and enable <c>coldplug</c>, type the following:
467     </p>
468    
469     <pre caption="Emerging and enabling coldplug">
470     # <i>emerge coldplug</i>
471     # <i>rc-update add coldplug boot</i>
472     </pre>
473    
474     <p>
475     Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>.
476 swift 1.1 </p>
477    
478     </body>
479     </section>
480 swift 1.19
481 swift 1.1 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20