/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml
Gentoo

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.59 Revision 1.60
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
5<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 5<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml,v 1.59 2008/08/21 14:44:44 swift Exp $ --> 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 8
9<sections> 9<sections>
10 10
11<version>9.1</version> 11<version>9.1</version>
12<date>2008-08-21</date> 12<date>2008-08-21</date>
39<body> 39<body>
40 40
41<p> 41<p>
42The core around which all distributions are built is the Linux kernel. It is the 42The core around which all distributions are built is the Linux kernel. It is the
43layer between the user programs and your system hardware. Gentoo provides its 43layer between the user programs and your system hardware. Gentoo provides its
44users several possible kernels to choose from. A full listing with description 44users several possible kernels to choose from. A full listing with description
45is available at the 45is available at the
46<uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel Guide</uri>. 46<uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel Guide</uri>.
47</p> 47</p>
48 48
49<p> 49<p>
50We suggest using <c>gentoo-sources</c> on PPC, which is a recent 2.6 kernel. 50We suggest using <c>gentoo-sources</c> on PPC, which is a recent 2.6 kernel.
51</p> 51</p>
65# <i>ls -l /usr/src/linux</i> 65# <i>ls -l /usr/src/linux</i>
66lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-<keyval id="kernel-gentoo"/> 66lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-<keyval id="kernel-gentoo"/>
67</pre> 67</pre>
68 68
69<p> 69<p>
70Now it is time to configure and compile your kernel source. You can use 70Now 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 71<c>genkernel</c> for this, which will build a generic kernel as used by the
72Installation CD. We explain the "manual" configuration first though, as it is 72Installation CD. We explain the "manual" configuration first though, as it is
73a more efficient configuration. 73a more efficient configuration.
74</p> 74</p>
75 75
76<p> 76<p>
77If you want to manually configure your kernel, continue now with <uri 77If you want to manually configure your kernel, continue now with <uri
78link="#manual">Default: Manual Configuration</uri>. If you want to use 78link="#manual">Default: Manual Configuration</uri>. If you want to use
79<c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using 79<c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
80genkernel</uri> instead. 80genkernel</uri> instead.
81</p> 81</p>
82 82
83</body> 83</body>
84</subsection> 84</subsection>
95few kernels you won't even remember that it was difficult ;) 95few kernels you won't even remember that it was difficult ;)
96</p> 96</p>
97 97
98<p> 98<p>
99However, one thing <e>is</e> true: you must know your system when you start 99However, one thing <e>is</e> true: you must know your system when you start
100configuring a kernel manually. Most information can be gathered by emerging 100configuring a kernel manually. Most information can be gathered by emerging
101pciutils (<c>emerge pciutils</c>) which contains the program 101pciutils (<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 102<c>lspci</c>. You will now be able to use <c>lspci</c> within the chrooted
103environment. You may safely ignore any <e>pcilib</e> warnings (such as pcilib: 103environment. You may safely ignore any <e>pcilib</e> warnings (such as pcilib:
104cannot open /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, 104cannot open /sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively,
105you can run <c>lspci</c> from a <e>non-chrooted</e> environment. The results 105you can run <c>lspci</c> from a <e>non-chrooted</e> environment. The results
106are the same. You can also run <c>lsmod</c> to see what kernel modules the 106are the same. You can also run <c>lsmod</c> to see what kernel modules the
107Installation CD uses (it might provide you with a nice hint on what to enable). 107Installation CD uses (it might provide you with a nice hint on what to enable).
108Another place to look for clues as to what components to enable is to check the 108Another place to look for clues as to what components to enable is to check the
109kernel message logs from the successful boot that got you this far. Type 109kernel message logs from the successful boot that got you this far. Type
110<c>dmesg</c> to see these kernel messages. 110<c>dmesg</c> to see these kernel messages.
111</p> 111</p>
213</pre> 213</pre>
214 214
215<p> 215<p>
216At this time, full kernel preemption may still be unstable on PPC and may cause 216At this time, full kernel preemption may still be unstable on PPC and may cause
217compilation failures and random segfaults. It is <e>strongly</e> suggested 217compilation failures and random segfaults. It is <e>strongly</e> suggested
218that you do not use this feature. Both <e>Voluntary Preemption</e> and 218that you do not use this feature. Both <e>Voluntary Preemption</e> and
219<e>No Forced Preemption</e> should be safe. 219<e>No Forced Preemption</e> should be safe.
220</p> 220</p>
221 221
222<pre caption="Ensure the Preemptible Kernel Option is Off"> 222<pre caption="Ensure the Preemptible Kernel Option is Off">
223Kernel options ---&gt; 223Kernel options ---&gt;
224<comment>(Select One)</comment> 224<comment>(Select One)</comment>
225 Preemption Model 225 Preemption Model
226 (X) No Forced Preemption (Server) 226 (X) No Forced Preemption (Server)
227 (X) Voluntary Kernel Preemption (Desktop) 227 (X) Voluntary Kernel Preemption (Desktop)
228</pre> 228</pre>
229 229
230<p> 230<p>
291<subsection id="compiling"> 291<subsection id="compiling">
292<title>Compiling and Installing</title> 292<title>Compiling and Installing</title>
293<body> 293<body>
294 294
295<p> 295<p>
296Now that your kernel is configured, it is time to compile and install it. Exit 296Now that your kernel is configured, it is time to compile and install it. Exit
297the configuration menu and run the following commands: 297the configuration menu and run the following commands:
298</p> 298</p>
299 299
300<pre caption="Compiling the kernel"> 300<pre caption="Compiling the kernel">
301# <i>make &amp;&amp; make modules_install</i> 301# <i>make &amp;&amp; make modules_install</i>
302</pre> 302</pre>
303 303
304<p> 304<p>
305When the kernel has finished compiling, copy the kernel image to 305When the kernel has finished compiling, copy the kernel image to
306<path>/boot</path> as shown below. If you have a separate boot partition, as 306<path>/boot</path> as shown below. If you have a separate boot partition, as
307on Pegasos computers, be sure that it is mounted properly. If you are using 307on Pegasos computers, be sure that it is mounted properly. If you are using
308BootX to boot, we'll copy the kernel later. 308BootX to boot, we'll copy the kernel later.
309</p> 309</p>
310 310
311<p> 311<p>
312Yaboot and BootX expect to use an uncompressed kernel unlike many other 312Yaboot and BootX expect to use an uncompressed kernel unlike many other
321# <i>cd /usr/src/linux</i> 321# <i>cd /usr/src/linux</i>
322<comment>Note, your kernel version might be different</comment> 322<comment>Note, your kernel version might be different</comment>
323<comment>(Apple/IBM)</comment> 323<comment>(Apple/IBM)</comment>
324# <i>cp vmlinux /boot/<keyval id="kernel-name"/></i> 324# <i>cp vmlinux /boot/<keyval id="kernel-name"/></i>
325<comment>(Pegasos)</comment> 325<comment>(Pegasos)</comment>
326# <i>cp arch/powerpc/boot/images/zImage /boot/<keyval id="kernel-name" /></i> 326# <i>cp arch/powerpc/boot/images/zImage /boot/<keyval id="kernel-name" /></i>
327</pre> 327</pre>
328 328
329<p> 329<p>
330Now continue with <uri link="#kernel_modules">Kernel Modules</uri>. 330Now continue with <uri link="#kernel_modules">Kernel Modules</uri>.
331</p> 331</p>
356<pre caption="Emerging genkernel"> 356<pre caption="Emerging genkernel">
357# <i>emerge genkernel</i> 357# <i>emerge genkernel</i>
358</pre> 358</pre>
359 359
360<p> 360<p>
361Next, copy over the kernel configuration used by the Installation CD to the 361Next, copy over the kernel configuration used by the Installation CD to the
362location where genkernel looks for the default kernel configuration: 362location where genkernel looks for the default kernel configuration:
363</p> 363</p>
364 364
365<pre caption="Copying over the Installation CD kernel config"> 365<pre caption="Copying over the Installation CD kernel config">
366# <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i> 366# <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i>
367</pre> 367</pre>
368 368
369<p> 369<p>
370If you are using firewire or USB to boot, you'll need to add modules to the 370If you are using firewire or USB to boot, you'll need to add modules to the
371initrd. Edit <path>/usr/share/genkernel/ppc/modules_load</path> and change 371initrd. Edit <path>/usr/share/genkernel/ppc/modules_load</path> and change
372<c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for firewire support or 372<c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for firewire support or
373<c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support. 373<c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support.
374</p> 374</p>
375 375
382</p> 382</p>
383 383
384<pre caption="Removing /boot from /etc/fstab on machines without a boot partition"> 384<pre caption="Removing /boot from /etc/fstab on machines without a boot partition">
385# <i>nano -w /etc/fstab</i> 385# <i>nano -w /etc/fstab</i>
386<comment>Remove this line</comment> 386<comment>Remove this line</comment>
387/dev/BOOT /boot ext2 noauto,noatime 1 2 387/dev/BOOT /boot ext2 noauto,noatime 1 2
388</pre> 388</pre>
389 389
390<p> 390<p>
391Now, compile your kernel sources by running <c>genkernel --genzimage all</c>. 391Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
392For Pegasos, we will need to use a different config and create a zImage instead 392For Pegasos, we will need to use a different config and create a zImage instead
393of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c> 393of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c>
394compiles a kernel that supports almost all hardware, this compilation can take 394compiles a kernel that supports almost all hardware, this compilation can take
395quite a while to finish! 395quite a while to finish!
396</p> 396</p>
397 397
398<p> 398<p>
399Note that, if your partition where the kernel should be located doesn't use ext2 399Note that, if your partition where the kernel should be located doesn't use ext2
400or ext3 as filesystem you might need to manually configure your kernel using 400or ext3 as filesystem you might need to manually configure your kernel using
401<c>genkernel --menuconfig all</c> and add support for your 401<c>genkernel --menuconfig all</c> and add support for your
402filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or 402filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or
403LVM2 will probably want to add <c>--evms2</c> or <c>--lvm2</c> as an argument as 403LVM2 will probably want to add <c>--evms2</c> or <c>--lvm2</c> as an argument as
404well. 404well.
405</p> 405</p>
406 406
411<pre caption="Running genkernel on the Pegasos"> 411<pre caption="Running genkernel on the Pegasos">
412# <i>genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all</i> 412# <i>genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all</i>
413</pre> 413</pre>
414 414
415<p> 415<p>
416Once <c>genkernel</c> completes, a kernel, full set of modules and 416Once <c>genkernel</c> completes, a kernel, full set of modules and
417<e>initial root disk</e> (initrd) will be created. We will use the kernel 417<e>initial root disk</e> (initrd) will be created. We will use the kernel
418and initrd when configuring a boot loader later in this document. Write 418and initrd when configuring a boot loader later in this document. Write
419down the names of the kernel and initrd as you will need them when writing 419down the names of the kernel and initrd as you will need them when writing
420the bootloader configuration file. The initrd will be started immediately after 420the bootloader configuration file. The initrd will be started immediately after
421booting to perform hardware autodetection (just like on the Installation CD) 421booting to perform hardware autodetection (just like on the Installation CD)
422before your "real" system starts up. Be sure to also copy down the required 422before your "real" system starts up. Be sure to also copy down the required
423boot arguments, these are required for a successful boot with genkernel. 423boot arguments, these are required for a successful boot with genkernel.
424</p> 424</p>
425 425
426<pre caption="Checking the created kernel image name and initrd"> 426<pre caption="Checking the created kernel image name and initrd">

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60

  ViewVC Help
Powered by ViewVC 1.1.20