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

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

  ViewVC Help
Powered by ViewVC 1.1.20