/[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.34 Revision 1.46
1<?xml version='1.0' encoding='UTF-8'?> 1<?xml version='1.0' encoding='UTF-8'?>
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/1.0 --> 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.34 2005/08/09 09:43:58 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml,v 1.46 2007/02/26 08:54:53 nightmorph Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<version>2.11</version> 11<version>7.4</version>
12<date>2005-08-09</date> 12<date>2007-02-26</date>
13 13
14<section> 14<section>
15<title>Timezone</title> 15<title>Timezone</title>
16<body> 16<body>
17 17
18<p> 18<p>
19First, select your timezone so that your system knows where it is located. Look 19You first need to select your timezone so that your system knows where it is
20for your timezone in <path>/usr/share/zoneinfo</path>, then make a symlink to 20located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then copy
21<path>/etc/localtime</path> using <c>ln</c>: 21it to <path>/etc/localtime</path>. Please avoid the
22<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
23indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8.
22</p> 24</p>
23 25
24<pre caption="Setting the timezone information"> 26<pre caption="Setting the timezone information">
25# <i>ls /usr/share/zoneinfo</i> 27# <i>ls /usr/share/zoneinfo</i>
26<comment>(Suppose you want to use GMT)</comment> 28<comment>(Suppose you want to use GMT)</comment>
27# <i>ln -sf /usr/share/zoneinfo/GMT /etc/localtime</i> 29# <i>cp /usr/share/zoneinfo/GMT /etc/localtime</i>
28</pre> 30</pre>
29 31
30</body> 32</body>
31</section> 33</section>
32<section> 34<section>
34<subsection> 36<subsection>
35<title>Choosing a Kernel</title> 37<title>Choosing a Kernel</title>
36<body> 38<body>
37 39
38<p> 40<p>
39The base that all distributions are built upon is the Linux kernel. It is the 41The core around which all distributions are built is the Linux kernel. It is the
40layer between the your programs and your system hardware. Gentoo provides its 42layer between the user programs and your system hardware. Gentoo provides its
41users several possible kernel sources. A full listing with description is 43users several possible kernel sources. A full listing with description is
42available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel 44available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
43Guide</uri>. 45Guide</uri>.
44</p> 46</p>
45 47
46<p> 48<p>
47We suggest using either <c>vanilla-sources</c> or <c>gentoo-sources</c> 49We suggest using <c>gentoo-sources</c> on PPC, which is a 2.6 kernel.
48on PPC, which are both 2.6 kernels. The latter is available when you
49perform a networkless installation. So let's continue with <c>emerge</c>'ing
50the kernel sources:
51</p> 50</p>
52 51
53<pre caption="Installing the kernel source"> 52<pre caption="Installing a kernel source">
54# <i>emerge gentoo-sources</i> 53# <i>emerge gentoo-sources</i>
55</pre> 54</pre>
56 55
57<note>
58The suggested sources at the time of the 2005.1 release are
59<c>gentoo-sources-2.6.12-r4</c> and <c>vanilla-sources-2.6.12.2</c>.
60</note>
61
62<p> 56<p>
63If you take a look in <path>/usr/src</path> you should see a symlink named 57If you take a look in <path>/usr/src</path> you should see a symlink named
64<path>linux</path> pointing to your current kernel source. Here, we will assume 58<path>linux</path> pointing to your current kernel source. In this case, the
65that the kernel source installed is <c>gentoo-sources-2.6.12-r4</c>: 59installed kernel source points to <c>gentoo-sources-2.6.15</c>. Your version
60may be different, so keep this in mind.
66</p> 61</p>
67 62
68<pre caption="Viewing the kernel source symlink"> 63<pre caption="Viewing the kernel source symlink">
69# <i>ls -l /usr/src/linux</i> 64# <i>ls -l /usr/src/linux</i>
70lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-2.6.12-gentoo-r4 65lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-2.6.15
71</pre> 66</pre>
72 67
73<p>
74If the symlink doesn't point to the kernel source of your choice (note that
75<c>linux-2.6.12-gentoo-r4</c> is merely an example) you should change it to the
76desired kernel sources:
77</p> 68<p>
78
79<pre caption="Changing the kernel source symlink">
80# <i>rm /usr/src/linux</i>
81# <i>cd /usr/src</i>
82# <i>ln -s linux-2.6.12-gentoo-r4 linux</i>
83</pre>
84
85<p>
86It is now time to configure and compile your kernel source. You can use 69Now it is time to configure and compile your kernel source. You
87<c>genkernel</c> to build a generic kernel similar to the one used by the 70can use <c>genkernel</c> for this, which will build a generic kernel as used
88Installation CD, or you can perform a manual configuration to best suit your 71by the Installation CD. We explain the "manual" configuration first though, as
89system. 72it is the best way to optimize your environment.
90</p> 73</p>
91 74
92<p> 75<p>
93If you want to manually configure your kernel, continue now with <uri 76If you want to manually configure your kernel, continue now with <uri
94link="#manual">Default: Manual Configuration</uri>. If you want to use 77link="#manual">Default: Manual Configuration</uri>. If you want to use
105<title>Introduction</title> 88<title>Introduction</title>
106<body> 89<body>
107 90
108<p> 91<p>
109Manually configuring a kernel is often seen as the most difficult procedure a 92Manually configuring a kernel is often seen as the most difficult procedure a
110Linux user ever has to perform. Nothing is less true, after configuring a 93Linux user ever has to perform. Nothing is less true -- after configuring a
111couple of kernels you won't even remember it being that difficult ;) 94couple of kernels you don't even remember that it was difficult ;)
112</p>
113
114<p> 95</p>
115Building a successful you must know what is in your system when 96
97<p>
98However, one thing <e>is</e> true: you must know your system when you start
116you start configuring a kernel manually. Most information can be gathered by 99configuring a kernel manually. Most information can be gathered by emerging
117emerging pciutils <c>emerge pciutils</c> which contains <c>lspci</c>. You 100pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now
118can
119be able to use <c>lspci</c> within the chrooted environment. You may safely 101be able to use <c>lspci</c> within the chrooted environment. You may safely
120ignore any <e>pcilib</e> warnings (like pcilib: cannot open 102ignore any <e>pcilib</e> warnings (like pcilib: cannot open
121/sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run 103/sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
122<c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same. 104<c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
123You can also run <c>lsmod</c> to see what kernel modules the Installation CD 105You can also run <c>lsmod</c> to see what kernel modules the Installation CD
126message logs from the successful boot that got you this far. Type <c>dmesg</c> 108message logs from the successful boot that got you this far. Type <c>dmesg</c>
127to see the kernel messages. 109to see the kernel messages.
128</p> 110</p>
129 111
130<p> 112<p>
131Now go to your kernel source directory and execute <c>make menuconfig</c>. This 113Now, go to your kernel source directory, it's time to configure your kernel.
132will fire up an ncurses-based configuration menu. 114It is recommended that you add the default settings to your configuration by
115first running <c>make pmac32_defconfig</c>. After the default configuration has
116been generated, run <c>make menuconfig</c> which will fire up an ncurses-based
117configuration menu.
133</p> 118</p>
134 119
135<pre caption="Invoking menuconfig"> 120<pre caption="Invoking menuconfig">
136# <i>cd /usr/src/linux</i> 121# <i>cd /usr/src/linux</i>
122# <i>make pmac32_defconfig</i>
137# <i>make menuconfig</i> 123# <i>make menuconfig</i>
138</pre> 124</pre>
139 125
140<p> 126<p>
141You will be greeted with several configuration sections. We'll first list some 127You will be greeted with several configuration sections. We'll first list some
152<p> 138<p>
153First of all, activate the use of development and experimental code/drivers. 139First of all, activate the use of development and experimental code/drivers.
154You need this, otherwise some very important code/drivers won't show up: 140You need this, otherwise some very important code/drivers won't show up:
155</p> 141</p>
156 142
157<pre caption="Selecting experimental code/drivers, General setup"> 143<pre caption="Selecting experimental code/drivers">
158Code maturity level options ---&gt; 144Code maturity level options ---&gt;
159 [*] Prompt for development and/or incomplete code/drivers 145 [*] Prompt for development and/or incomplete code/drivers
160General setup --->
161 [*] Support for hot-pluggable devices
162</pre> 146</pre>
163 147
164<p> 148<p>
165Now go to <c>File Systems</c> and select support for the filesystems you use. 149Now go to <c>File Systems</c> and select support for the filesystems you use.
166<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be 150<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
167able to mount your partitions. Also select <c>/proc file system</c> and 151able to mount your partitions. Also select the <c>/proc file system</c> and
168<c>Virtual memory</c>. Do <e>not</e> select the <c>/dev file system</c>. 152<c>Virtual memory</c>. Make sure that you also enable support for Amiga
153partitions if you are using a Pegasos, or Macintosh partitions if you are using
154an Apple computer.
169</p> 155</p>
170 156
171<pre caption="Selecting necessary file systems"> 157<pre caption="Selecting necessary file systems">
172File systems ---&gt; 158File systems ---&gt;
173 Pseudo Filesystems ---&gt; 159 Pseudo Filesystems ---&gt;
174 [*] /proc file system support 160 [*] /proc file system support
175 [ ] /dev file system support (OBSOLETE)
176 [*] Virtual memory file system support (former shm fs) 161 [*] Virtual memory file system support (former shm fs)
162 Partition Types ---&gt;
163 [*] Amiga partition table support
164 [*] Macintosh partition map support
177 165
178<comment>(Select one or more of the following options as needed by your system)</comment> 166<comment>(Select one or more of the following options as needed by your system)</comment>
167 &lt;*&gt; Reiserfs support
168 &lt;*&gt; Ext3 journalling file system support
179 &lt;*&gt; Second extended fs support 169 &lt;*&gt; Second extended fs support
180 &lt;*&gt; Ext3 journalling file system support
181 &lt;*&gt; Reiserfs support
182 &lt;*&gt; XFS filesystem support 170 &lt;*&gt; XFS filesystem support
183</pre> 171</pre>
184 172
185<p> 173<p>
186If you are using PPPoE to connect to the Internet or you are using a dial-up 174If you are using PPPoE to connect to the Internet or you are using a dial-up
222compilation failures and random segfaults. It is <e>strongly</e> suggested 210compilation failures and random segfaults. It is <e>strongly</e> suggested
223that you do not use this feature. 211that you do not use this feature.
224</p> 212</p>
225 213
226<pre caption="Ensure the Preemptible Kernel Option is Off"> 214<pre caption="Ensure the Preemptible Kernel Option is Off">
227Platform options ---&gt; 215Kernel options ---&gt;
228 [ ] Preemptible Kernel 216 Preemption Model (No Forced Preemption (Server))
229</pre> 217</pre>
230 218
231<p> 219<p>
232If you're booting from Firewire, you'll need to enable these options. If you 220If you're booting from Firewire, you'll need to enable these options. If you do
233do not want to compile in support, you'll need to include these modules and 221not want to compile in support, you'll need to include these modules and their
234their dependencies in an initrd. 222dependencies in an initrd.
235</p> 223</p>
236 224
237<pre caption="Enable support for firewire devices on boot"> 225<pre caption="Enable support for firewire devices on boot">
238Device Drivers ---&gt; 226Device Drivers ---&gt;
239 IEEE 1394 (FireWire) support ---&gt; 227 IEEE 1394 (FireWire) support ---&gt;
302# <i>make &amp;&amp; make modules_install</i> 290# <i>make &amp;&amp; make modules_install</i>
303</pre> 291</pre>
304 292
305<p> 293<p>
306When the kernel has finished compiling, copy the kernel image to 294When the kernel has finished compiling, copy the kernel image to
307<path>/boot</path> (be sure that it is mounted properly on the Pegasos). 295<path>/boot</path> (be sure that it is mounted properly on Pegasos computers).
296If you are using BootX to boot, we'll copy the kernel later.
297</p>
298
299<p>
300Yaboot and BootX expect to use an uncompressed kernel unlike many other
301bootloaders. The uncompressed kernel is called vmlinux and it is placed in
302<path>/usr/src/linux</path> after the kernel has finished compiling. If you
303are using a Pegasos machine, the Pegasos firmware requires a compressed
304kernel called zImage.chrp which can be found in
305<path>/usr/src/linux/arch/ppc/boot/images</path>.
308</p> 306</p>
309 307
310<pre caption="Installing the kernel"> 308<pre caption="Installing the kernel">
311<comment>replace 2.6.12 with your kernel-version</comment> 309# <i>cd /usr/src/linux</i>
312(Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.12</i> 310<comment>replace &lt;kernel-version&gt; with your kernel version</comment>
311<comment>(Apple/IBM)</comment>
312# <i>cp vmlinux /boot/&lt;kernel-version&gt;</i>
313<comment>(Pegasos)</comment>
313(Pegasos) # <i>cp arch/ppc/boot/images/zImage.chrp /boot/kernel-2.6.12</i> 314# <i>cp arch/ppc/boot/images/zImage.chrp /boot/&lt;kernel-version&gt;</i>
314</pre>
315
316<p>
317It is also wise to copy over your kernel configuration file to
318<path>/boot</path>, just in case :)
319</p>
320
321<pre caption="Backing up your kernel configuration">
322# <i>cp .config /boot/config-2.6.12-gentoo-r4</i>
323</pre> 315</pre>
324 316
325<p> 317<p>
326Now continue with <uri link="#kernel_modules">Installing Separate Kernel 318Now continue with <uri link="#kernel_modules">Installing Separate Kernel
327Modules</uri>. 319Modules</uri>.
337<body> 329<body>
338 330
339<p> 331<p>
340You should list the modules you want automatically loaded in 332You should list the modules you want automatically loaded in
341<path>/etc/modules.autoload.d/kernel-2.6</path>. 333<path>/etc/modules.autoload.d/kernel-2.6</path>.
342You can add extra options to the modules too if needed. 334You can add extra options to the modules too if you want.
343</p> 335</p>
344 336
345<p> 337<p>
346To view all available modules, run the following <c>find</c> command. Don't 338To view all available modules, run the following <c>find</c> command. Don't
347forget to substitute "&lt;kernel version&gt;" with the version of the kernel you 339forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
387Now that your kernel source tree is installed, it's now time to compile your 379Now that your kernel source tree is installed, it's now time to compile your
388kernel by using our <c>genkernel</c> script to automatically build a kernel for 380kernel by using our <c>genkernel</c> script to automatically build a kernel for
389you. <c>genkernel</c> works by configuring a kernel nearly identically to the 381you. <c>genkernel</c> works by configuring a kernel nearly identically to the
390way our Installation CD kernel is configured. This means that when you use 382way our Installation CD kernel is configured. This means that when you use
391<c>genkernel</c> to build your kernel, your system will generally detect all 383<c>genkernel</c> to build your kernel, your system will generally detect all
392your hardware at boot-time, just like our Installation CD does. 384your hardware at boot-time, just like our Installation CD does. Because
393Because genkernel doesn't require any manual kernel configuration, it is an 385genkernel doesn't require any manual kernel configuration, it is an ideal
394ideal solution for those users who may not be comfortable compiling their own 386solution for those users who may not be comfortable compiling their own kernels.
395kernels.
396</p> 387</p>
397 388
398<p> 389<p>
399Now, let's see how to use genkernel. First, emerge the genkernel ebuild: 390Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
400</p> 391</p>
416If you are using firewire or USB to boot, you'll need to add modules to the 407If you are using firewire or USB to boot, you'll need to add modules to the
417initrd. Edit <path>/usr/share/genkernel/ppc/modules_load</path> and change 408initrd. Edit <path>/usr/share/genkernel/ppc/modules_load</path> and change
418<c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for firewire support or 409<c>MODULES_FIREWIRE="ieee1394 ohci1394 sbp2"</c> for firewire support or
419<c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support. 410<c>MODULES_USB="usbcore ohci-hcd ehci-hcd usb-storage"</c> for USB support.
420</p> 411</p>
412
413<p>
414Before compiling your sources, the fstab needs a slight adjustment. The rest of
415the fstab will be completed during a later step, so don't worry about the
416details now. If you did not create a separate boot partition (NOT bootstrap,
417that's different), remove the line referencing /boot from
418<path>/etc/fstab</path>. This will need to be done on most Apple computers.
419</p>
420
421<pre caption="Removing /boot from /etc/fstab on machines without a boot partition">
422# <i>nano -w /etc/fstab</i>
423<comment>Remove this line</comment>
424/dev/BOOT /boot ext2 noauto,noatime 1 2
425</pre>
421 426
422<p> 427<p>
423Now, compile your kernel sources by running <c>genkernel --genzimage all</c>. 428Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
424For Pegasos, we will need to use a different config and create a zImage instead 429For Pegasos, we will need to use a different config and create a zImage instead
425of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c> 430of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c>
428</p> 433</p>
429 434
430<p> 435<p>
431Note that, if your partition where the kernel should be located doesn't use ext2 436Note that, if your partition where the kernel should be located doesn't use ext2
432or ext3 as filesystem you might need to manually configure your kernel using 437or ext3 as filesystem you might need to manually configure your kernel using
433<c>genkernel --menuconfig --genzimage all</c> and add support for your 438<c>genkernel --menuconfig all</c> and add support for your
434filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or 439filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or
435LVM2 will probably want to add <c>--evms2</c> or <c>--lvm2</c> as argument as 440LVM2 will probably want to add <c>--evms2</c> or <c>--lvm2</c> as argument as
436well. 441well.
437</p> 442</p>
438 443
454before your "real" system starts up. Be sure to also copy down the required 459before your "real" system starts up. Be sure to also copy down the required
455boot arguments, these are required for a successful boot with genkernel. 460boot arguments, these are required for a successful boot with genkernel.
456</p> 461</p>
457 462
458<pre caption="Checking the created kernel image name and initrd"> 463<pre caption="Checking the created kernel image name and initrd">
459# <i>ls /boot/kernel* /boot/initrd*</i> 464# <i>ls /boot/kernel* /boot/initramfs*</i>
460</pre> 465</pre>
461 466
462<p> 467<p>
463Now, let's perform one more step to get our system to be more like the 468If you want your system to be more like the Installation CD you should,
464Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects 469when your Gentoo installation is over, emerge <c>coldplug</c>. While the
465hardware that is needed to boot your system, <c>coldplug</c> autodetects 470initrd autodetects hardware that is needed to boot your system,
466everything else. To emerge and enable <c>coldplug</c>, type the following: 471<c>coldplug</c> autodetects everything else. <c>coldplug</c> is available as one
472of the packages on the Package CD.
467</p> 473</p>
468 474
469<pre caption="Emerging and enabling coldplug"> 475<pre caption="Emerging and enabling coldplug">
476<comment>(Do this after the installation, during the GRP installation instructions)</comment>
470# <i>emerge coldplug</i> 477# <i>emerge -k coldplug</i>
471# <i>rc-update add coldplug boot</i> 478# <i>rc-update add coldplug boot</i>
472</pre> 479</pre>
473 480
481<note>
482You no longer need to emerge <c>coldplug</c> if you're using <c>udev</c> version
483103 and higher. If you receive a message that <c>udev</c> blocks <c>coldplug</c>
484from being installed, then you don't need to install <c>coldplug</c>.
485</note>
486
487<p>
488If you want your system to react to hotplugging events, you will need to install
489and setup <c>hotplug</c> as well:
490</p>
491
492<pre caption="Emerging and enabling hotplug">
493# <i>emerge hotplug</i>
494# <i>rc-update add hotplug default</i>
495</pre>
496
474<p> 497<p>
475Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>. 498Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>.
476</p> 499</p>
477 500
478</body> 501</body>
479</section> 502</section>
480 503
481</sections> 504</sections>
505

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.46

  ViewVC Help
Powered by ViewVC 1.1.20