/[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.61 - (show annotations) (download) (as text)
Wed Jul 21 00:52:41 2010 UTC (4 years, 1 month ago) by nightmorph
Branch: MAIN
Changes since 1.60: +44 -42 lines
File MIME type: application/xml
Update the PPC handbook for the autobuilds. Major version bump for this release. Fixes bug 260403, bug 292726, and bug 234310.

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

  ViewVC Help
Powered by ViewVC 1.1.20