/[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.50 - (show annotations) (download) (as text)
Thu May 17 16:56:43 2007 UTC (7 years, 4 months ago) by rane
Branch: MAIN
Changes since 1.49: +2 -2 lines
File MIME type: application/xml
fixed a typo, thx to kucrut

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

  ViewVC Help
Powered by ViewVC 1.1.20