/[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.70 - (show annotations) (download) (as text)
Sat Oct 6 20:16:10 2012 UTC (23 months, 1 week ago) by swift
Branch: MAIN
Changes since 1.69: +4 -4 lines
File MIME type: application/xml
Part of bug #437338 - Do not set the dump (5th) field in fstab to 1, it might confuse users and isnt used anyway

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.69 2012/02/22 21:27:45 swift Exp $ -->
8
9 <sections>
10
11 <abstract>
12 The Linux kernel is the core of every distribution. This chapter
13 explains how to configure your kernel.
14 </abstract>
15
16 <version>15</version>
17 <date>2012-10-06</date>
18
19 <section>
20 <title>Timezone</title>
21 <body>
22
23 <p>
24 You first need to select your timezone so that your system knows where it is
25 located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy
26 it to <path>/etc/localtime</path>. Please avoid the
27 <path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
28 indicate the expected zones. For instance, <path>GMT-8</path> is in fact
29 GMT+8.
30 </p>
31
32 <pre caption="Setting the timezone information">
33 # <i>ls /usr/share/zoneinfo</i>
34 <comment>(Suppose you want to use Europe/Brussels)</comment>
35 # <i>cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime</i>
36 <comment>(Next set the timezone)</comment>
37 # <i>echo "Europe/Brussels" &gt; /etc/timezone</i>
38 </pre>
39
40 </body>
41 </section>
42 <section>
43 <title>Installing the Kernel Sources</title>
44 <subsection>
45 <title>Choosing a Kernel</title>
46 <body>
47
48 <p>
49 The core around which all distributions are built is the Linux kernel. It is the
50 layer between the user programs and your system hardware. Gentoo provides its
51 users several possible kernel sources. A full listing with description is
52 available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
53 Guide</uri>.
54 </p>
55
56 <p>
57 For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c>
58 (kernel source patched for extra features).
59 </p>
60
61 <p>
62 Choose your kernel source and install it using <c>emerge</c>.
63 </p>
64
65 <pre caption="Installing a kernel source">
66 # <i>emerge gentoo-sources</i>
67 </pre>
68
69 <p>
70 When you take a look in <path>/usr/src</path> you should see a symlink called
71 <path>linux</path> pointing to your kernel source. In this case, the installed
72 kernel source points to <c>gentoo-sources-<keyval id="kernel-version"/></c>.
73 Your version may be different, so keep this in mind.
74 </p>
75
76 <pre caption="Viewing the kernel source symlink">
77 # <i>ls -l /usr/src/linux</i>
78 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
79 </pre>
80
81 <p>
82 Now it is time to configure and compile your kernel source. You can use
83 <c>genkernel</c> for this, which will build a generic kernel as used by the
84 Installation CD. We explain the "manual" configuration first though, as it is
85 the best way to optimize your environment.
86 </p>
87
88 <p>
89 If you want to manually configure your kernel, continue now with <uri
90 link="#manual">Default: Manual Configuration</uri>. If you want to use
91 <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
92 genkernel</uri> instead.
93 </p>
94
95 </body>
96 </subsection>
97 </section>
98 <section id="manual">
99 <title>Default: Manual Configuration</title>
100 <subsection>
101 <title>Introduction</title>
102 <body>
103
104 <p>
105 Manually configuring a kernel is often seen as the most difficult procedure a
106 Linux user ever has to perform. Nothing is less true -- after configuring a
107 few kernels you won't even remember that it was difficult ;)
108 </p>
109
110 <p>
111 However, one thing <e>is</e> true: you must know your system when you start
112 configuring a kernel manually. Most information can be gathered by emerging
113 pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
114 be able to use <c>lspci</c> within the chrooted environment. You may safely
115 ignore any <e>pcilib</e> warnings (like pcilib: cannot open
116 /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
117 <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
118 You can also run <c>lsmod</c> to see what kernel modules the Installation CD
119 uses (it might provide you with a nice hint on what to enable).
120 </p>
121
122 <p>
123 Now, go to your kernel source directory, it's time to configure your kernel.
124 Start by configuring a kernel that will boot on most 32 Bit PowerPC machines
125 by first running <c>make pmac32_defconfig</c>. After the default configuration
126 has been generated, run <c>make menuconfig</c> to start an ncurses-based
127 configuration menu.
128 </p>
129
130 <pre caption="Invoking menuconfig">
131 # <i>cd /usr/src/linux</i>
132 # <i>make pmac32_defconfig</i>
133 # <i>make menuconfig</i>
134 </pre>
135
136 <p>
137 You will be greeted with several configuration sections. We'll first list some
138 options you must activate (otherwise Gentoo will not function, or not function
139 properly without additional tweaks).
140 </p>
141
142 </body>
143 </subsection>
144 <subsection>
145 <title>Activating Required Options</title>
146 <body>
147
148 <p>
149 First go to <c>File Systems</c> and select support for the filesystems you use.
150 <e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
151 able to mount your partitions. Also select the <c>/proc file system</c> and
152 <c>Virtual memory</c>. Make sure that you also enable support for Amiga
153 partitions if you are using a Pegasos, or Macintosh partitions if you are using
154 an Apple computer.
155 </p>
156
157 <pre caption="Selecting necessary file systems">
158 File systems ---&gt;
159 Pseudo Filesystems ---&gt;
160 <comment>(/proc may already be forced on by your configuration, if so, you'll see --- instead)</comment>
161 [*] /proc file system support
162 [*] Virtual memory file system support (former shm fs)
163 Partition Types ---&gt;
164 [*] Advanced partition support
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;M&gt; Apple Macintosh file system support
185 &lt;M&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 If you're booting from FireWire, you'll need to enable these options. If you do
226 not want to compile in support, you'll need to include these modules and their
227 dependencies in an initrd.
228 </p>
229
230 <pre caption="Enable support for FireWire devices on boot">
231 Device Drivers ---&gt;
232 IEEE 1394 (FireWire) support ---&gt;
233 &lt;*&gt; IEEE 1394 (FireWire) support
234 &lt;*&gt; OHCI-1394 support
235 &lt;*&gt; SBP-2 support (Harddisks etc.)
236 </pre>
237
238 <p>
239 If you're booting from USB, you'll need to enable these options. If you do not
240 want to compile in support, you'll need to include these modules and their
241 dependencies in an initrd.
242 </p>
243
244 <pre caption="Enable support for USB devices on boot">
245 Device Drivers ---&gt;
246 USB support ---&gt;
247 &lt;*&gt; Support for Host-side USB
248 &lt;*&gt; OHCI HCD support
249 &lt;*&gt; USB Mass Storage support
250 </pre>
251
252 <p>
253 Do not turn off kernel framebuffer support as it is required for a successful
254 boot. If you are using an NVIDIA based chipset, you should use the Open
255 Firmware framebuffer. If you are using an ATI based chipset, you should select
256 the framebuffer driver based upon your chipset (Mach64, Rage128 or Radeon).
257 </p>
258
259 <pre caption="Choosing a Framebuffer Driver">
260 Device Drivers ---&gt;
261 Graphics support ---&gt;
262 &lt;*&gt; Support for frame buffer devices
263 [*] Open Firmware frame buffer device support
264 &lt;*&gt; ATI Radeon display support
265 &lt;*&gt; ATI Rage128 display support
266 &lt;*&gt; ATI Mach64 display support
267 Console display driver support ---&gt;
268 &lt;*&gt; Framebuffer Console support
269 </pre>
270
271 <note>
272 If you select more than one framebuffer device, it may default to a less than
273 optimal driver. Either use only one framebuffer device or specify which to use
274 by passing the driver to use to the kernel on boot by appending a video line
275 such as: <c>video=radeonfb</c>.
276 </note>
277
278 <p>
279 When you're done configuring your kernel, continue with <uri
280 link="#compiling">Compiling and Installing</uri>.
281 </p>
282
283 </body>
284 </subsection>
285 <subsection id="compiling">
286 <title>Compiling and Installing</title>
287 <body>
288
289 <p>
290 Now that your kernel is configured, it is time to compile and install it. Exit
291 the configuration menu and run the following commands:
292 </p>
293
294 <pre caption="Compiling the kernel">
295 # <i>make &amp;&amp; make modules_install</i>
296 </pre>
297
298 <p>
299 When the kernel has finished compiling, copy the kernel image to
300 <path>/boot</path> as shown below. If you have a separate boot partition, as
301 on Pegasos computers, be sure that it is mounted properly. If you are using
302 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 are
309 using a Pegasos machine, the Pegasos firmware requires a compressed kernel
310 called zImage which can be found in
311 <path>/usr/src/linux/arch/powerpc/boot/images</path>.
312 </p>
313
314 <pre caption="Installing the kernel">
315 # <i>cd /usr/src/linux</i>
316 <comment>Note, your kernel version might be different</comment>
317 <comment>(Apple/IBM)</comment>
318 # <i>cp vmlinux /boot/<keyval id="kernel-name"/></i>
319 <comment>(Pegasos)</comment>
320 # <i>cp arch/powerpc/boot/images/zImage /boot/<keyval id="kernel-name"/></i>
321 </pre>
322
323 <p>
324 Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
325 </p>
326
327 </body>
328 </subsection>
329 </section>
330 <section id="genkernel">
331 <title>Alternative: Using genkernel</title>
332 <body>
333
334 <p>
335 Now that your kernel source tree is installed, it's now time to compile your
336 kernel by using our <c>genkernel</c> script to automatically build a kernel for
337 you. <c>genkernel</c> works by configuring a kernel nearly identically to the
338 way our Installation CD kernel is configured. This means that when you use
339 <c>genkernel</c> to build your kernel, your system will generally detect all
340 your hardware at boot-time, just like our Installation CD does. Because
341 genkernel doesn't require any manual kernel configuration, it is an ideal
342 solution for those users who may not be comfortable compiling their own
343 kernels.
344 </p>
345
346 <p>
347 Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
348 </p>
349
350 <pre caption="Emerging genkernel">
351 # <i>emerge genkernel</i>
352 </pre>
353
354 <p>
355 If you are using FireWire or USB to boot, you'll need to add modules to the
356 initrd. Edit <path>/usr/share/genkernel/arch/ppc/modules_load</path> and change
357 <c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for FireWire support or
358 <c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support.
359 </p>
360
361 <p>
362 Before compiling your sources, the fstab needs a slight adjustment. The rest of
363 the fstab will be completed during a later step, so don't worry about the
364 details now. If you did not create a separate boot partition (NOT bootstrap,
365 that's different), remove the line referencing <path>/boot</path> from
366 <path>/etc/fstab</path>. This will need to be done on most Apple computers.
367 </p>
368
369 <pre caption="Removing /boot from /etc/fstab on machines without a boot partition">
370 # <i>nano -w /etc/fstab</i>
371 <comment>Remove this line</comment>
372 /dev/BOOT /boot ext2 noauto,noatime 0 2
373 </pre>
374
375 <p>
376 Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
377 For Pegasos, we will need to use a different config and create a zImage instead
378 of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c>
379 compiles a kernel that supports almost all hardware, this compilation can take
380 quite a while to finish!
381 </p>
382
383 <p>
384 Note that, if your partition where the kernel should be located doesn't use ext2
385 or ext3 as filesystem you might need to manually configure your kernel using
386 <c>genkernel --menuconfig all</c> and add support for your
387 filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of LVM2
388 will probably want to add <c>--lvm2</c> as an argument as well.
389 </p>
390
391 <pre caption="Running genkernel">
392 # <i>genkernel all</i>
393 </pre>
394
395 <pre caption="Running genkernel on the Pegasos">
396 # <i>genkernel --genzimage all</i>
397 </pre>
398
399 <p>
400 Once <c>genkernel</c> completes, a kernel, full set of modules and
401 <e>initial ram disk</e> (initramfs) will be created. We will use the kernel
402 and initrd when configuring a boot loader later in this document. Write
403 down the names of the kernel and initrd as you will need them when writing
404 the bootloader configuration file. The initrd will be started immediately after
405 booting to perform hardware autodetection (just like on the Installation CD)
406 before your "real" system starts up. Be sure to also copy down the required
407 boot arguments, these are required for a successful boot with genkernel.
408 </p>
409
410 <pre caption="Checking the created kernel image name and initrd">
411 <comment>Note, your kernel version might be different</comment>
412 # <i>ls /boot/<keyval id="genkernel-name"/> /boot/<keyval id="genkernel-initrd"/></i>
413 </pre>
414
415 <p>
416 Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
417 </p>
418
419 </body>
420 </section>
421 <section id="kernel_modules">
422 <title>Kernel Modules</title>
423
424 <subsection>
425 <include href="hb-install-kernelmodules.xml"/>
426 </subsection>
427
428 </section>
429 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20