/[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.76 - (hide annotations) (download) (as text)
Sun May 11 07:26:10 2014 UTC (15 months, 3 weeks ago) by swift
Branch: MAIN
CVS Tags: HEAD
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 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 neysx 1.36 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 swift 1.1
7 swift 1.76 <!-- $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 $ -->
8 swift 1.1
9     <sections>
10 swift 1.12
11 nightmorph 1.62 <abstract>
12     The Linux kernel is the core of every distribution. This chapter
13     explains how to configure your kernel.
14     </abstract>
15    
16 swift 1.76 <version>21</version>
17     <date>2014-05-11</date>
18 swift 1.12
19 swift 1.1 <section>
20 nightmorph 1.48 <title>Installing the Kernel Sources</title>
21 swift 1.1 <subsection>
22     <title>Choosing a Kernel</title>
23     <body>
24    
25     <p>
26 nightmorph 1.42 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 nightmorph 1.61 users several possible kernel sources. A full listing with description is
29 swift 1.75 available at the <uri link="https://wiki.gentoo.org/wiki/Kernel/Overview">Gentoo Kernel
30 nightmorph 1.61 Guide</uri>.
31 swift 1.1 </p>
32    
33     <p>
34 nightmorph 1.61 For <keyval id="arch"/>-based systems we have <c>gentoo-sources</c>
35     (kernel source patched for extra features).
36     </p>
37    
38     <p>
39     Choose your kernel source and install it using <c>emerge</c>.
40 swift 1.1 </p>
41    
42 nightmorph 1.42 <pre caption="Installing a kernel source">
43 nightmorph 1.46 # <i>emerge gentoo-sources</i>
44 swift 1.1 </pre>
45    
46     <p>
47 nightmorph 1.61 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 swift 1.1 </p>
52    
53     <pre caption="Viewing the kernel source symlink">
54     # <i>ls -l /usr/src/linux</i>
55 nightmorph 1.61 lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-<keyval id="kernel-version"/>
56 swift 1.1 </pre>
57    
58     <p>
59 swift 1.60 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 nightmorph 1.48 Installation CD. We explain the "manual" configuration first though, as it is
62 nightmorph 1.61 the best way to optimize your environment.
63 swift 1.1 </p>
64    
65     <p>
66 swift 1.19 If you want to manually configure your kernel, continue now with <uri
67 swift 1.60 link="#manual">Default: Manual Configuration</uri>. If you want to use
68     <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
69 swift 1.19 genkernel</uri> instead.
70 swift 1.1 </p>
71    
72     </body>
73     </subsection>
74     </section>
75     <section id="manual">
76 swift 1.19 <title>Default: Manual Configuration</title>
77 swift 1.1 <subsection>
78     <title>Introduction</title>
79     <body>
80    
81     <p>
82 neysx 1.10 Manually configuring a kernel is often seen as the most difficult procedure a
83 nightmorph 1.42 Linux user ever has to perform. Nothing is less true -- after configuring a
84 nightmorph 1.48 few kernels you won't even remember that it was difficult ;)
85 swift 1.1 </p>
86    
87     <p>
88 neysx 1.37 However, one thing <e>is</e> true: you must know your system when you start
89 nightmorph 1.61 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 swift 1.1 </p>
98    
99     <p>
100 nightmorph 1.42 Now, go to your kernel source directory, it's time to configure your kernel.
101 nightmorph 1.48 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 nightmorph 1.42 configuration menu.
105 swift 1.1 </p>
106    
107     <pre caption="Invoking menuconfig">
108     # <i>cd /usr/src/linux</i>
109 josejx 1.43 # <i>make pmac32_defconfig</i>
110 swift 1.1 # <i>make menuconfig</i>
111     </pre>
112    
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 swift 1.76 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 swift 1.1 </p>
120    
121     </body>
122     </subsection>
123     <subsection>
124     <title>Activating Required Options</title>
125     <body>
126    
127     <p>
128 nightmorph 1.58 First go to <c>File Systems</c> and select support for the filesystems you use.
129 swift 1.73 <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 swift 1.1 </p>
135    
136     <pre caption="Selecting necessary file systems">
137 dertobi123 1.6 File systems ---&gt;
138     Pseudo Filesystems ---&gt;
139 nightmorph 1.48 <comment>(/proc may already be forced on by your configuration, if so, you'll see --- instead)</comment>
140 dertobi123 1.6 [*] /proc file system support
141     [*] Virtual memory file system support (former shm fs)
142 nightmorph 1.42 Partition Types ---&gt;
143 josejx 1.53 [*] Advanced partition support
144     [*] Amiga partition table support
145     [*] Macintosh partition map support
146 dertobi123 1.6
147 swift 1.1 <comment>(Select one or more of the following options as needed by your system)</comment>
148 nightmorph 1.42 &lt;*&gt; Reiserfs support
149     &lt;*&gt; Ext3 journalling file system support
150 swift 1.34 &lt;*&gt; Second extended fs support
151 swift 1.1 &lt;*&gt; XFS filesystem support
152     </pre>
153    
154     <p>
155 nightmorph 1.61 Users of NewWorld and OldWorld machines will want HFS support as well. OldWorld
156 nightmorph 1.48 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>
159    
160     <pre caption="Activating HFS support">
161     File Systems ---&gt;
162     Miscellaneous filesystems ---&gt;
163 josejx 1.53 &lt;M&gt; Apple Macintosh file system support
164     &lt;M&gt; Apple Extended HFS file system support
165 nightmorph 1.48 </pre>
166    
167     <p>
168 swift 1.1 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>
171    
172     <pre caption="Selecting PPPoE necessary drivers">
173 neysx 1.4 Device Drivers ---&gt;
174 nightmorph 1.48 Network device support ---&gt;
175 neysx 1.4 &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 swift 1.1 </pre>
179    
180     <p>
181 nightmorph 1.48 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 swift 1.1 </p>
185    
186     <p>
187 nightmorph 1.61 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 nightmorph 1.48 the BMAC driver.
190 swift 1.1 </p>
191    
192 nightmorph 1.48 <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 josejx 1.53 &lt;*&gt; Sun GEM support
201 swift 1.1 </pre>
202    
203     <p>
204 nightmorph 1.61 If you're booting from FireWire, you'll need to enable these options. If you do
205 nightmorph 1.42 not want to compile in support, you'll need to include these modules and their
206     dependencies in an initrd.
207 swift 1.34 </p>
208    
209 nightmorph 1.61 <pre caption="Enable support for FireWire devices on boot">
210 swift 1.34 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>
216    
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>
222    
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>
230    
231     <p>
232 josejx 1.33 Do not turn off kernel framebuffer support as it is required for a successful
233 nightmorph 1.61 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 nightmorph 1.54 the framebuffer driver based upon your chipset (Mach64, Rage128 or Radeon).
236 josejx 1.33 </p>
237    
238 nightmorph 1.48 <pre caption="Choosing a Framebuffer Driver">
239 josejx 1.33 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>
249    
250     <note>
251     If you select more than one framebuffer device, it may default to a less than
252 nightmorph 1.61 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 josejx 1.33 </note>
256    
257     <p>
258 swift 1.72 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>
261    
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>
268    
269     <p>
270 swift 1.1 When you're done configuring your kernel, continue with <uri
271     link="#compiling">Compiling and Installing</uri>.
272     </p>
273    
274     </body>
275     </subsection>
276     <subsection id="compiling">
277     <title>Compiling and Installing</title>
278     <body>
279    
280     <p>
281 swift 1.60 Now that your kernel is configured, it is time to compile and install it. Exit
282 nightmorph 1.48 the configuration menu and run the following commands:
283 swift 1.1 </p>
284    
285     <pre caption="Compiling the kernel">
286 swift 1.34 # <i>make &amp;&amp; make modules_install</i>
287 swift 1.1 </pre>
288    
289     <p>
290 neysx 1.10 When the kernel has finished compiling, copy the kernel image to
291 nightmorph 1.48 <path>/boot</path> as shown below. If you have a separate boot partition, as
292 swift 1.60 on Pegasos computers, be sure that it is mounted properly. If you are using
293 nightmorph 1.48 BootX to boot, we'll copy the kernel later.
294 fox2mike 1.39 </p>
295    
296     <p>
297 nightmorph 1.48 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 swift 1.1 </p>
304    
305     <pre caption="Installing the kernel">
306 fox2mike 1.39 # <i>cd /usr/src/linux</i>
307 nightmorph 1.48 <comment>Note, your kernel version might be different</comment>
308 fox2mike 1.39 <comment>(Apple/IBM)</comment>
309 nightmorph 1.48 # <i>cp vmlinux /boot/<keyval id="kernel-name"/></i>
310 fox2mike 1.39 <comment>(Pegasos)</comment>
311 nightmorph 1.61 # <i>cp arch/powerpc/boot/images/zImage /boot/<keyval id="kernel-name"/></i>
312 swift 1.1 </pre>
313    
314     <p>
315 nightmorph 1.58 Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
316 swift 1.19 </p>
317    
318     </body>
319     </subsection>
320     </section>
321     <section id="genkernel">
322     <title>Alternative: Using genkernel</title>
323     <body>
324    
325     <p>
326 nightmorph 1.48 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 swift 1.19 </p>
336    
337     <p>
338     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
339     </p>
340    
341     <pre caption="Emerging genkernel">
342     # <i>emerge genkernel</i>
343     </pre>
344    
345     <p>
346 nightmorph 1.61 If you are using FireWire or USB to boot, you'll need to add modules to the
347 nightmorph 1.64 initrd. Edit <path>/usr/share/genkernel/arch/ppc/modules_load</path> and change
348 nightmorph 1.61 <c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for FireWire support or
349 swift 1.34 <c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support.
350     </p>
351    
352 josejx 1.44 <p>
353     Before compiling your sources, the fstab needs a slight adjustment. The rest of
354 nightmorph 1.48 the fstab will be completed during a later step, so don't worry about the
355 josejx 1.44 details now. If you did not create a separate boot partition (NOT bootstrap,
356 nightmorph 1.48 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 josejx 1.44 </p>
359    
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 swift 1.70 /dev/BOOT /boot ext2 noauto,noatime 0 2
364 josejx 1.44 </pre>
365 nightmorph 1.42
366 swift 1.34 <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 swift 1.60 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 swift 1.34 quite a while to finish!
372 swift 1.19 </p>
373    
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 swift 1.60 <c>genkernel --menuconfig all</c> and add support for your
378 swift 1.68 filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of LVM2
379 swift 1.74 will probably want to add <c>--lvm</c> as an argument as well.
380 swift 1.19 </p>
381    
382     <pre caption="Running genkernel">
383 swift 1.34 # <i>genkernel all</i>
384     </pre>
385    
386     <pre caption="Running genkernel on the Pegasos">
387 nightmorph 1.64 # <i>genkernel --genzimage all</i>
388 sejo 1.15 </pre>
389 swift 1.19
390 sejo 1.17 <p>
391 swift 1.60 Once <c>genkernel</c> completes, a kernel, full set of modules and
392 swift 1.66 <e>initial ram disk</e> (initramfs) will be created. We will use the kernel
393 swift 1.19 and initrd when configuring a boot loader later in this document. Write
394 nightmorph 1.48 down the names of the kernel and initrd as you will need them when writing
395 swift 1.60 the bootloader configuration file. The initrd will be started immediately after
396     booting to perform hardware autodetection (just like on the Installation CD)
397 josejx 1.22 before your "real" system starts up. Be sure to also copy down the required
398 swift 1.34 boot arguments, these are required for a successful boot with genkernel.
399 sejo 1.17 </p>
400 swift 1.19
401     <pre caption="Checking the created kernel image name and initrd">
402 nightmorph 1.48 <comment>Note, your kernel version might be different</comment>
403 nightmorph 1.61 # <i>ls /boot/<keyval id="genkernel-name"/> /boot/<keyval id="genkernel-initrd"/></i>
404 nightmorph 1.42 </pre>
405    
406     <p>
407 nightmorph 1.58 Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
408 swift 1.1 </p>
409    
410     </body>
411     </section>
412 nightmorph 1.58 <section id="kernel_modules">
413     <title>Kernel Modules</title>
414    
415     <subsection>
416     <include href="hb-install-kernelmodules.xml"/>
417     </subsection>
418    
419     </section>
420 swift 1.1 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20