Contents of /xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.76 - (show annotations) (download) (as text)
Sun May 11 07:26:10 2014 UTC (4 years ago) by swift
Branch: MAIN
Changes since 1.75: +6 -4 lines
File MIME type: application/xml
Add link to kernel configuration guide on the wiki as per suggestion on #gentoo-doc by micsha

1 <?xml version='1.0' encoding='UTF-8'?>
2 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
4 <!-- The content of this document is licensed under the CC-BY-SA license -->
5 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
7 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml,v 1.75 2013/12/17 10:38:05 swift Exp $ -->
9 <sections>
11 <abstract>
12 The Linux kernel is the core of every distribution. This chapter
13 explains how to configure your kernel.
14 </abstract>
16 <version>21</version>
17 <date>2014-05-11</date>
19 <section>
20 <title>Installing the Kernel Sources</title>
21 <subsection>
22 <title>Choosing a Kernel</title>
23 <body>
25 <p>
26 The core around which all distributions are built is the Linux kernel. It is the
27 layer between the user programs and your system hardware. Gentoo provides its
28 users several possible kernel sources. A full listing with description is
29 available at the <uri link="https://wiki.gentoo.org/wiki/Kernel/Overview">Gentoo Kernel
30 Guide</uri>.
31 </p>
33 <p>
34 For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c>
35 (kernel source patched for extra features).
36 </p>
38 <p>
39 Choose your kernel source and install it using <c>emerge</c>.
40 </p>
42 <pre caption="Installing a kernel source">
43 # <i>emerge gentoo-sources</i>
44 </pre>
46 <p>
47 When you take a look in <path>/usr/src</path> you should see a symlink called
48 <path>linux</path> pointing to your kernel source. In this case, the installed
49 kernel source points to <c>gentoo-sources-<keyval id="kernel-version"/></c>.
50 Your version may be different, so keep this in mind.
51 </p>
53 <pre caption="Viewing the kernel source symlink">
54 # <i>ls -l /usr/src/linux</i>
55 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
56 </pre>
58 <p>
59 Now it is time to configure and compile your kernel source. You can use
60 <c>genkernel</c> for this, which will build a generic kernel as used by the
61 Installation CD. We explain the "manual" configuration first though, as it is
62 the best way to optimize your environment.
63 </p>
65 <p>
66 If you want to manually configure your kernel, continue now with <uri
67 link="#manual">Default: Manual Configuration</uri>. If you want to use
68 <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
69 genkernel</uri> instead.
70 </p>
72 </body>
73 </subsection>
74 </section>
75 <section id="manual">
76 <title>Default: Manual Configuration</title>
77 <subsection>
78 <title>Introduction</title>
79 <body>
81 <p>
82 Manually configuring a kernel is often seen as the most difficult procedure a
83 Linux user ever has to perform. Nothing is less true -- after configuring a
84 few kernels you won't even remember that it was difficult ;)
85 </p>
87 <p>
88 However, one thing <e>is</e> true: you must know your system when you start
89 configuring a kernel manually. Most information can be gathered by emerging
90 pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
91 be able to use <c>lspci</c> within the chrooted environment. You may safely
92 ignore any <e>pcilib</e> warnings (like pcilib: cannot open
93 /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
94 <c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
95 You can also run <c>lsmod</c> to see what kernel modules the Installation CD
96 uses (it might provide you with a nice hint on what to enable).
97 </p>
99 <p>
100 Now, go to your kernel source directory, it's time to configure your kernel.
101 Start by configuring a kernel that will boot on most 32 Bit PowerPC machines
102 by first running <c>make pmac32_defconfig</c>. After the default configuration
103 has been generated, run <c>make menuconfig</c> to start an ncurses-based
104 configuration menu.
105 </p>
107 <pre caption="Invoking menuconfig">
108 # <i>cd /usr/src/linux</i>
109 # <i>make pmac32_defconfig</i>
110 # <i>make menuconfig</i>
111 </pre>
113 <p>
114 You will be greeted with several configuration sections. We'll first list some
115 options you must activate (otherwise Gentoo will not function, or not function
116 properly without additional tweaks). We also have a <uri
117 link="https://wiki.gentoo.org/wiki/Kernel/Gentoo_Kernel_Configuration_Guide">Gentoo
118 Kernel Configuration Guide</uri> on the Gentoo wiki that might help you further.
119 </p>
121 </body>
122 </subsection>
123 <subsection>
124 <title>Activating Required Options</title>
125 <body>
127 <p>
128 First go to <c>File Systems</c> and select support for the filesystems you use.
129 <e>Don't</e> compile the file system you use for the root filesystem as module,
130 otherwise your Gentoo system will not be able to mount your partition. Also
131 select <c>Virtual memory</c> and <c>/proc file system</c>. Make sure that you
132 also enable support for Amiga partitions if you are using a Pegasos, or
133 Macintosh partitions if you are using an Apple computer.
134 </p>
136 <pre caption="Selecting necessary file systems">
137 File systems ---&gt;
138 Pseudo Filesystems ---&gt;
139 <comment>(/proc may already be forced on by your configuration, if so, you'll see --- instead)</comment>
140 [*] /proc file system support
141 [*] Virtual memory file system support (former shm fs)
142 Partition Types ---&gt;
143 [*] Advanced partition support
144 [*] Amiga partition table support
145 [*] Macintosh partition map support
147 <comment>(Select one or more of the following options as needed by your system)</comment>
148 &lt;*&gt; Reiserfs support
149 &lt;*&gt; Ext3 journalling file system support
150 &lt;*&gt; Second extended fs support
151 &lt;*&gt; XFS filesystem support
152 </pre>
154 <p>
155 Users of NewWorld and OldWorld machines will want HFS support as well. OldWorld
156 users require it for copying compiled kernels to the MacOS partition. NewWorld
157 users require it for configuring the special Apple_Bootstrap partition:
158 </p>
160 <pre caption="Activating HFS support">
161 File Systems ---&gt;
162 Miscellaneous filesystems ---&gt;
163 &lt;M&gt; Apple Macintosh file system support
164 &lt;M&gt; Apple Extended HFS file system support
165 </pre>
167 <p>
168 If you are using PPPoE to connect to the Internet or you are using a dial-up
169 modem, you will need the following options in the kernel:
170 </p>
172 <pre caption="Selecting PPPoE necessary drivers">
173 Device Drivers ---&gt;
174 Network device support ---&gt;
175 &lt;*&gt; PPP (point-to-point protocol) support
176 &lt;*&gt; PPP support for async serial ports
177 &lt;*&gt; PPP support for sync tty ports
178 </pre>
180 <p>
181 The two compression options won't harm but are not always needed. The <c>PPP
182 over Ethernet</c> option might only be used by <c>ppp</c> when configured to
183 perform kernel mode PPPoE.
184 </p>
186 <p>
187 Don't forget to include support in the kernel for your ethernet card! Most
188 newer Apple computers use the SunGEM ethernet driver. Older iMacs commonly use
189 the BMAC driver.
190 </p>
192 <pre caption="Selecting the network driver">
193 Device Drivers ---&gt;
194 Network device support ---&gt;
195 Ethernet (10 or 100Mbit) ---&gt;
196 [*] Ethernet (10 or 100Mbit)
197 &lt;*&gt; Generic Media Independent Interface device support
198 &lt;*&gt; MACE (Power Mac ethernet) support
199 &lt;*&gt; BMAC (G3 ethernet) support
200 &lt;*&gt; Sun GEM support
201 </pre>
203 <p>
204 If you're booting from FireWire, you'll need to enable these options. If you do
205 not want to compile in support, you'll need to include these modules and their
206 dependencies in an initrd.
207 </p>
209 <pre caption="Enable support for FireWire devices on boot">
210 Device Drivers ---&gt;
211 IEEE 1394 (FireWire) support ---&gt;
212 &lt;*&gt; IEEE 1394 (FireWire) support
213 &lt;*&gt; OHCI-1394 support
214 &lt;*&gt; SBP-2 support (Harddisks etc.)
215 </pre>
217 <p>
218 If you're booting from USB, you'll need to enable these options. If you do not
219 want to compile in support, you'll need to include these modules and their
220 dependencies in an initrd.
221 </p>
223 <pre caption="Enable support for USB devices on boot">
224 Device Drivers ---&gt;
225 USB support ---&gt;
226 &lt;*&gt; Support for Host-side USB
227 &lt;*&gt; OHCI HCD support
228 &lt;*&gt; USB Mass Storage support
229 </pre>
231 <p>
232 Do not turn off kernel framebuffer support as it is required for a successful
233 boot. If you are using an NVIDIA based chipset, you should use the Open
234 Firmware framebuffer. If you are using an ATI based chipset, you should select
235 the framebuffer driver based upon your chipset (Mach64, Rage128 or Radeon).
236 </p>
238 <pre caption="Choosing a Framebuffer Driver">
239 Device Drivers ---&gt;
240 Graphics support ---&gt;
241 &lt;*&gt; Support for frame buffer devices
242 [*] Open Firmware frame buffer device support
243 &lt;*&gt; ATI Radeon display support
244 &lt;*&gt; ATI Rage128 display support
245 &lt;*&gt; ATI Mach64 display support
246 Console display driver support ---&gt;
247 &lt;*&gt; Framebuffer Console support
248 </pre>
250 <note>
251 If you select more than one framebuffer device, it may default to a less than
252 optimal driver. Either use only one framebuffer device or specify which to use
253 by passing the driver to use to the kernel on boot by appending a video line
254 such as: <c>video=radeonfb</c>.
255 </note>
257 <p>
258 Next select <e>Maintain a devtmpfs file system to mount at /dev</e> so that
259 critical device files are already available early in the boot process.
260 </p>
262 <pre caption="Enabling devtmpfs support">
263 Device Drivers ---&gt;
264 Generic Driver Options ---&gt;
265 [*] Maintain a devtmpfs filesystem to mount at /dev
266 [ ] Automount devtmpfs at /dev, after the kernel mounted the rootfs
267 </pre>
269 <p>
270 When you're done configuring your kernel, continue with <uri
271 link="#compiling">Compiling and Installing</uri>.
272 </p>
274 </body>
275 </subsection>
276 <subsection id="compiling">
277 <title>Compiling and Installing</title>
278 <body>
280 <p>
281 Now that your kernel is configured, it is time to compile and install it. Exit
282 the configuration menu and run the following commands:
283 </p>
285 <pre caption="Compiling the kernel">
286 # <i>make &amp;&amp; make modules_install</i>
287 </pre>
289 <p>
290 When the kernel has finished compiling, copy the kernel image to
291 <path>/boot</path> as shown below. If you have a separate boot partition, as
292 on Pegasos computers, be sure that it is mounted properly. If you are using
293 BootX to boot, we'll copy the kernel later.
294 </p>
296 <p>
297 Yaboot and BootX expect to use an uncompressed kernel unlike many other
298 bootloaders. The uncompressed kernel is called vmlinux and it is placed in
299 <path>/usr/src/linux</path> after the kernel has finished compiling. If you are
300 using a Pegasos machine, the Pegasos firmware requires a compressed kernel
301 called zImage which can be found in
302 <path>/usr/src/linux/arch/powerpc/boot/images</path>.
303 </p>
305 <pre caption="Installing the kernel">
306 # <i>cd /usr/src/linux</i>
307 <comment>Note, your kernel version might be different</comment>
308 <comment>(Apple/IBM)</comment>
309 # <i>cp vmlinux /boot/<keyval id="kernel-name"/></i>
310 <comment>(Pegasos)</comment>
311 # <i>cp arch/powerpc/boot/images/zImage /boot/<keyval id="kernel-name"/></i>
312 </pre>
314 <p>
315 Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
316 </p>
318 </body>
319 </subsection>
320 </section>
321 <section id="genkernel">
322 <title>Alternative: Using genkernel</title>
323 <body>
325 <p>
326 Now that your kernel source tree is installed, it's now time to compile your
327 kernel by using our <c>genkernel</c> script to automatically build a kernel for
328 you. <c>genkernel</c> works by configuring a kernel nearly identically to the
329 way our Installation CD kernel is configured. This means that when you use
330 <c>genkernel</c> to build your kernel, your system will generally detect all
331 your hardware at boot-time, just like our Installation CD does. Because
332 genkernel doesn't require any manual kernel configuration, it is an ideal
333 solution for those users who may not be comfortable compiling their own
334 kernels.
335 </p>
337 <p>
338 Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
339 </p>
341 <pre caption="Emerging genkernel">
342 # <i>emerge genkernel</i>
343 </pre>
345 <p>
346 If you are using FireWire or USB to boot, you'll need to add modules to the
347 initrd. Edit <path>/usr/share/genkernel/arch/ppc/modules_load</path> and change
348 <c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for FireWire support or
349 <c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support.
350 </p>
352 <p>
353 Before compiling your sources, the fstab needs a slight adjustment. The rest of
354 the fstab will be completed during a later step, so don't worry about the
355 details now. If you did not create a separate boot partition (NOT bootstrap,
356 that's different), remove the line referencing <path>/boot</path> from
357 <path>/etc/fstab</path>. This will need to be done on most Apple computers.
358 </p>
360 <pre caption="Removing /boot from /etc/fstab on machines without a boot partition">
361 # <i>nano -w /etc/fstab</i>
362 <comment>Remove this line</comment>
363 /dev/BOOT /boot ext2 noauto,noatime 0 2
364 </pre>
366 <p>
367 Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
368 For Pegasos, we will need to use a different config and create a zImage instead
369 of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c>
370 compiles a kernel that supports almost all hardware, this compilation can take
371 quite a while to finish!
372 </p>
374 <p>
375 Note that, if your partition where the kernel should be located doesn't use ext2
376 or ext3 as filesystem you might need to manually configure your kernel using
377 <c>genkernel --menuconfig all</c> and add support for your
378 filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of LVM2
379 will probably want to add <c>--lvm</c> as an argument as well.
380 </p>
382 <pre caption="Running genkernel">
383 # <i>genkernel all</i>
384 </pre>
386 <pre caption="Running genkernel on the Pegasos">
387 # <i>genkernel --genzimage all</i>
388 </pre>
390 <p>
391 Once <c>genkernel</c> completes, a kernel, full set of modules and
392 <e>initial ram disk</e> (initramfs) will be created. We will use the kernel
393 and initrd when configuring a boot loader later in this document. Write
394 down the names of the kernel and initrd as you will need them when writing
395 the bootloader configuration file. The initrd will be started immediately after
396 booting to perform hardware autodetection (just like on the Installation CD)
397 before your "real" system starts up. Be sure to also copy down the required
398 boot arguments, these are required for a successful boot with genkernel.
399 </p>
401 <pre caption="Checking the created kernel image name and initrd">
402 <comment>Note, your kernel version might be different</comment>
403 # <i>ls /boot/<keyval id="genkernel-name"/> /boot/<keyval id="genkernel-initrd"/></i>
404 </pre>
406 <p>
407 Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
408 </p>
410 </body>
411 </section>
412 <section id="kernel_modules">
413 <title>Kernel Modules</title>
415 <subsection>
416 <include href="hb-install-kernelmodules.xml"/>
417 </subsection>
419 </section>
420 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20