/[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.31 Revision 1.34
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/1.0 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml,v 1.31 2005/07/29 16:42:06 josejx Exp $ --> 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 $ -->
8 8
9<sections> 9<sections>
10 10
11<version>2.7</version> 11<version>2.11</version>
12<date>2005-06-09</date> 12<date>2005-08-09</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>
19You first need to select your timezone so that your system knows where it is 19First, select your timezone so that your system knows where it is located. Look
20located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then make a 20for your timezone in <path>/usr/share/zoneinfo</path>, then make a symlink to
21symlink to <path>/etc/localtime</path> using <c>ln</c>: 21<path>/etc/localtime</path> using <c>ln</c>:
22</p> 22</p>
23 23
24<pre caption="Setting the timezone information"> 24<pre caption="Setting the timezone information">
25# <i>ls /usr/share/zoneinfo</i> 25# <i>ls /usr/share/zoneinfo</i>
26<comment>(Suppose you want to use GMT)</comment> 26<comment>(Suppose you want to use GMT)</comment>
34<subsection> 34<subsection>
35<title>Choosing a Kernel</title> 35<title>Choosing a Kernel</title>
36<body> 36<body>
37 37
38<p> 38<p>
39The core around which all distributions are built is the Linux kernel. It is the 39The base that all distributions are built upon is the Linux kernel. It is the
40layer between the user programs and your system hardware. Gentoo provides its 40layer between the your programs and your system hardware. Gentoo provides its
41users several possible kernel sources. A full listing with description is 41users several possible kernel sources. A full listing with description is
42available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel 42available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
43Guide</uri>. 43Guide</uri>.
44</p> 44</p>
45 45
46<p> 46<p>
47For PPC you can choose between <c>vanilla-sources</c> and 47We suggest using either <c>vanilla-sources</c> or <c>gentoo-sources</c>
48<c>gentoo-sources</c> (both 2.6 kernels). The latter is available when you 48on PPC, which are both 2.6 kernels. The latter is available when you
49perform a networkless installation. Beside those there is a special 49perform a networkless installation. So let's continue with <c>emerge</c>'ing
50kernel-2.6-patchset for the Pegasos: <c>pegasos-sources</c>. So let's 50the kernel sources:
51continue with <c>emerge</c>'ing the kernel sources:
52</p> 51</p>
53 52
54<pre caption="Installing a kernel source"> 53<pre caption="Installing the kernel source">
55# <i>emerge gentoo-sources</i> 54# <i>emerge gentoo-sources</i>
56</pre> 55</pre>
57 56
58<note> 57<note>
59The PowerPC sources are based on a 2.6.10-kernel with security patches from 58The suggested sources at the time of the 2005.1 release are
602.6.11 backported. As the time of the release the 2.6.11 kernel produced 59<c>gentoo-sources-2.6.12-r4</c> and <c>vanilla-sources-2.6.12.2</c>.
61several problems on different PowerPC machines.
62</note> 60</note>
63 61
64<p> 62<p>
65When you take a look in <path>/usr/src</path> you should see a symlink called 63If you take a look in <path>/usr/src</path> you should see a symlink named
66<path>linux</path> pointing to your kernel source. We will assume the kernel 64<path>linux</path> pointing to your current kernel source. Here, we will assume
67source installed is <c>gentoo-sources-2.6.10-r8</c>: 65that the kernel source installed is <c>gentoo-sources-2.6.12-r4</c>:
68</p> 66</p>
69 67
70<pre caption="Viewing the kernel source symlink"> 68<pre caption="Viewing the kernel source symlink">
71# <i>ls -l /usr/src/linux</i> 69# <i>ls -l /usr/src/linux</i>
72lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-2.6.10-gentoo-r8 70lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-2.6.12-gentoo-r4
73</pre> 71</pre>
74 72
75<p> 73<p>
76If the symlink doesn't point to the kernel source of your choice (note that 74If the symlink doesn't point to the kernel source of your choice (note that
77<c>linux-2.6.10-gentoo-r8</c> is merely an example) you should change it to the 75<c>linux-2.6.12-gentoo-r4</c> is merely an example) you should change it to the
78right kernel: 76desired kernel sources:
79</p> 77</p>
80 78
81<pre caption="Changing the kernel source symlink"> 79<pre caption="Changing the kernel source symlink">
82# <i>rm /usr/src/linux</i> 80# <i>rm /usr/src/linux</i>
83# <i>cd /usr/src</i> 81# <i>cd /usr/src</i>
84# <i>ln -s linux-2.6.10-gentoo-r8 linux</i> 82# <i>ln -s linux-2.6.12-gentoo-r4 linux</i>
85</pre> 83</pre>
86 84
87<p> 85<p>
88Now it is time to configure and compile your kernel source. You 86It is now time to configure and compile your kernel source. You can use
89can use <c>genkernel</c> for this, which will build a generic kernel as used 87<c>genkernel</c> to build a generic kernel similar to the one used by the
90by the Installation CD. We explain the "manual" configuration first though, as 88Installation CD, or you can perform a manual configuration to best suit your
91it is the best way to optimize your environment. 89system.
92</p> 90</p>
93 91
94<p> 92<p>
95If you want to manually configure your kernel, continue now with <uri 93If you want to manually configure your kernel, continue now with <uri
96link="#manual">Default: Manual Configuration</uri>. If you want to use 94link="#manual">Default: Manual Configuration</uri>. If you want to use
107<title>Introduction</title> 105<title>Introduction</title>
108<body> 106<body>
109 107
110<p> 108<p>
111Manually configuring a kernel is often seen as the most difficult procedure a 109Manually configuring a kernel is often seen as the most difficult procedure a
112Linux user ever has to perform. Nothing is less true -- after configuring a 110Linux user ever has to perform. Nothing is less true, after configuring a
113couple of kernels you don't even remember that it was difficult ;) 111couple of kernels you won't even remember it being that difficult ;)
114</p>
115
116<p> 112</p>
117However, one thing <e>is</e> true: you must know your system when you start 113
114<p>
115Building a successful you must know what is in your system when
118configuring a kernel manually. Most information can be gathered by emerging 116you start configuring a kernel manually. Most information can be gathered by
119pciutils (<c>emerge pciutils</c>) which contains <c>lspci</c>. You will now 117emerging pciutils <c>emerge pciutils</c> which contains <c>lspci</c>. You
118can
120be able to use <c>lspci</c> within the chrooted environment. You may safely 119be able to use <c>lspci</c> within the chrooted environment. You may safely
121ignore any <e>pcilib</e> warnings (like pcilib: cannot open 120ignore any <e>pcilib</e> warnings (like pcilib: cannot open
122/sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run 121/sys/bus/pci/devices) that <c>lspci</c> throws out. Alternatively, you can run
123<c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same. 122<c>lspci</c> from a <e>non-chrooted</e> environment. The results are the same.
124You can also run <c>lsmod</c> to see what kernel modules the Installation CD 123You can also run <c>lsmod</c> to see what kernel modules the Installation CD
125uses (it might provide you with a nice hint on what to enable). 124uses (it might provide you with a nice hint on what to enable). Another place
125to look for clues as to what components to enable is to check the kernel
126message logs from the successful boot that got you this far. Type <c>dmesg</c>
127to see the kernel messages.
126</p> 128</p>
127 129
128<p> 130<p>
129Now go to your kernel source directory and execute <c>make menuconfig</c>. This 131Now go to your kernel source directory and execute <c>make menuconfig</c>. This
130will fire up an ncurses-based configuration menu. 132will fire up an ncurses-based configuration menu.
172 [*] /proc file system support 174 [*] /proc file system support
173 [ ] /dev file system support (OBSOLETE) 175 [ ] /dev file system support (OBSOLETE)
174 [*] Virtual memory file system support (former shm fs) 176 [*] Virtual memory file system support (former shm fs)
175 177
176<comment>(Select one or more of the following options as needed by your system)</comment> 178<comment>(Select one or more of the following options as needed by your system)</comment>
179 &lt;*&gt; Second extended fs support
180 &lt;*&gt; Ext3 journalling file system support
177 &lt;*&gt; Reiserfs support 181 &lt;*&gt; Reiserfs support
178 &lt;*&gt; Ext3 journalling file system support
179 &lt;*&gt; Second extended fs support
180 &lt;*&gt; XFS filesystem support 182 &lt;*&gt; XFS filesystem support
181</pre> 183</pre>
182 184
183<p> 185<p>
184If you are using PPPoE to connect to the Internet or you are using a dial-up 186If you are using PPPoE to connect to the Internet or you are using a dial-up
203If you require it, don't forget to include support in the kernel for your 205If you require it, don't forget to include support in the kernel for your
204ethernet card. 206ethernet card.
205</p> 207</p>
206 208
207<p> 209<p>
208Users of OldWorld machines will want HFS support so they can copy compiled 210Users of NewWorld and OldWorld machines will want HFS support as well. OldWorld
209kernels to the MacOS partition. This applies also to NewWorld machines as it is 211users require it for copying compiled kernels to the MacOS partition. NewWorld
210needed for the special Apple_Bootstrap partition: 212users require it for configuring the special Apple_Bootstrap partition:
211</p> 213</p>
212 214
213<pre caption="Activating HFS support"> 215<pre caption="Activating HFS support">
214File Systems ---&gt; 216File Systems ---&gt;
215 [*] HFS Support 217 [*] HFS Support
225Platform options ---&gt; 227Platform options ---&gt;
226 [ ] Preemptible Kernel 228 [ ] Preemptible Kernel
227</pre> 229</pre>
228 230
229<p> 231<p>
232If you're booting from Firewire, you'll need to enable these options. If you
233do not want to compile in support, you'll need to include these modules and
234their dependencies in an initrd.
235</p>
236
237<pre caption="Enable support for firewire devices on boot">
238Device Drivers ---&gt;
239 IEEE 1394 (FireWire) support ---&gt;
240 &lt;*&gt; IEEE 1394 (FireWire) support
241 &lt;*&gt; OHCI-1394 support
242 &lt;*&gt; SBP-2 support (Harddisks etc.)
243</pre>
244
245<p>
246If you're booting from USB, you'll need to enable these options. If you do not
247want to compile in support, you'll need to include these modules and their
248dependencies in an initrd.
249</p>
250
251<pre caption="Enable support for USB devices on boot">
252Device Drivers ---&gt;
253 USB support ---&gt;
254 &lt;*&gt; Support for Host-side USB
255 &lt;*&gt; OHCI HCD support
256 &lt;*&gt; USB Mass Storage support
257</pre>
258
259<p>
260Do not turn off kernel framebuffer support as it is required for a successful
261boot. If you are using an NVIDIA based chipset, you should use the OpenFirmware
262framebuffer. If you are using an ATI based chipset, you should select the
263framebuffer driver based upon your chipset (Mach64, Rage128 or Radeon).
264</p>
265
266<pre caption="Chosing a Framebuffer Driver">
267Device Drivers ---&gt;
268 Graphics support ---&gt;
269 &lt;*&gt; Support for frame buffer devices
270 [*] Open Firmware frame buffer device support
271 &lt;*&gt; ATI Radeon display support
272 &lt;*&gt; ATI Rage128 display support
273 &lt;*&gt; ATI Mach64 display support
274 Console display driver support ---&gt;
275 &lt;*&gt; Framebuffer Console support
276</pre>
277
278<note>
279If you select more than one framebuffer device, it may default to a less than
280optimal driver. Either use only one framebuffer device or specify which
281to use by passing the driver to use to the kernel on boot such as
282<c>video=radeonfb</c>.
283</note>
284
285<p>
230When you're done configuring your kernel, continue with <uri 286When you're done configuring your kernel, continue with <uri
231link="#compiling">Compiling and Installing</uri>. 287link="#compiling">Compiling and Installing</uri>.
232</p> 288</p>
233 289
234</body> 290</body>
241Now that your kernel is configured, it is time to compile and install it. Exit 297Now that your kernel is configured, it is time to compile and install it. Exit
242the configuration and run the commands which will compile the kernel: 298the configuration and run the commands which will compile the kernel:
243</p> 299</p>
244 300
245<pre caption="Compiling the kernel"> 301<pre caption="Compiling the kernel">
246# <i>make all &amp;&amp; make modules_install</i> 302# <i>make &amp;&amp; make modules_install</i>
247</pre> 303</pre>
248 304
249<p> 305<p>
250When the kernel has finished compiling, copy the kernel image to 306When the kernel has finished compiling, copy the kernel image to
251<path>/boot</path> (be sure that it is mounted properly on the Pegasos). 307<path>/boot</path> (be sure that it is mounted properly on the Pegasos).
252</p> 308</p>
253 309
254<pre caption="Installing the kernel"> 310<pre caption="Installing the kernel">
255<comment>replace 2.6.10 with your kernel-version</comment> 311<comment>replace 2.6.12 with your kernel-version</comment>
256(Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.10</i> 312(Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.12</i>
257(Pegasos) # <i>cp arch/ppc/boot/images/zImage.chrp /boot/kernel-2.6.10</i> 313(Pegasos) # <i>cp arch/ppc/boot/images/zImage.chrp /boot/kernel-2.6.12</i>
258</pre> 314</pre>
259 315
260<p> 316<p>
261It is also wise to copy over your kernel configuration file to 317It is also wise to copy over your kernel configuration file to
262<path>/boot</path>, just in case :) 318<path>/boot</path>, just in case :)
263</p> 319</p>
264 320
265<pre caption="Backing up your kernel configuration"> 321<pre caption="Backing up your kernel configuration">
266# <i>cp .config /boot/config-2.6.10-gentoo-r8</i> 322# <i>cp .config /boot/config-2.6.12-gentoo-r4</i>
267</pre> 323</pre>
268 324
269<p> 325<p>
270Now continue with <uri link="#kernel_modules">Installing Separate Kernel 326Now continue with <uri link="#kernel_modules">Installing Separate Kernel
271Modules</uri>. 327Modules</uri>.
281<body> 337<body>
282 338
283<p> 339<p>
284You should list the modules you want automatically loaded in 340You should list the modules you want automatically loaded in
285<path>/etc/modules.autoload.d/kernel-2.6</path>. 341<path>/etc/modules.autoload.d/kernel-2.6</path>.
286You can add extra options to the modules too if you want. 342You can add extra options to the modules too if needed.
287</p> 343</p>
288 344
289<p> 345<p>
290To view all available modules, run the following <c>find</c> command. Don't 346To view all available modules, run the following <c>find</c> command. Don't
291forget to substitute "&lt;kernel version&gt;" with the version of the kernel you 347forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
331Now that your kernel source tree is installed, it's now time to compile your 387Now that your kernel source tree is installed, it's now time to compile your
332kernel by using our <c>genkernel</c> script to automatically build a kernel for 388kernel by using our <c>genkernel</c> script to automatically build a kernel for
333you. <c>genkernel</c> works by configuring a kernel nearly identically to the 389you. <c>genkernel</c> works by configuring a kernel nearly identically to the
334way our Installation CD kernel is configured. This means that when you use 390way our Installation CD kernel is configured. This means that when you use
335<c>genkernel</c> to build your kernel, your system will generally detect all 391<c>genkernel</c> to build your kernel, your system will generally detect all
336your hardware at boot-time, just like our Installation CD does. Because genkernel 392your hardware at boot-time, just like our Installation CD does.
337doesn't require any manual kernel configuration, it is an ideal solution for 393Because genkernel doesn't require any manual kernel configuration, it is an
338those users who may not be comfortable compiling their own kernels. 394ideal solution for those users who may not be comfortable compiling their own
395kernels.
339</p> 396</p>
340 397
341<p> 398<p>
342Now, let's see how to use genkernel. First, emerge the genkernel ebuild: 399Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
343</p> 400</p>
354<pre caption="Copying over the Installation CD kernel config"> 411<pre caption="Copying over the Installation CD kernel config">
355# <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i> 412# <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i>
356</pre> 413</pre>
357 414
358<p> 415<p>
416If 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
418<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.
420</p>
421
422<p>
359Now, compile your kernel sources by running <c>genkernel --udev all</c>. 423Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
360Be aware though, as <c>genkernel</c> compiles a kernel that supports almost all 424For Pegasos, we will need to use a different config and create a zImage instead
361hardware, this compilation will take quite a while to finish! 425of the vmlinux kernel used on Apple machines. Be aware, as <c>genkernel</c>
426compiles a kernel that supports almost all hardware, this compilation can take
427quite a while to finish!
362</p> 428</p>
363 429
364<p> 430<p>
365Note that, if your partition where the kernel should be located doesn't use ext2 431Note that, if your partition where the kernel should be located doesn't use ext2
366or ext3 as filesystem you might need to manually configure your kernel using 432or ext3 as filesystem you might need to manually configure your kernel using
367<c>genkernel --menuconfig all</c> and add support for your filesystem <e>in</e> 433<c>genkernel --menuconfig --genzimage all</c> and add support for your
368the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or LVM2 will probably 434filesystem <e>in</e> the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or
369want to add <c>--evms2</c> or <c>--lvm2</c> as argument as well. 435LVM2 will probably want to add <c>--evms2</c> or <c>--lvm2</c> as argument as
436well.
370</p> 437</p>
371 438
372<pre caption="Running genkernel"> 439<pre caption="Running genkernel">
373# <i>genkernel --udev all</i> 440# <i>genkernel all</i>
441</pre>
442
443<pre caption="Running genkernel on the Pegasos">
444# <i>genkernel --genzimage --kernel-config=/usr/share/genkernel/ppc/Pegasos all</i>
374</pre> 445</pre>
375 446
376<p> 447<p>
377Once <c>genkernel</c> completes, a kernel, full set of modules and 448Once <c>genkernel</c> completes, a kernel, full set of modules and
378<e>initial root disk</e> (initrd) will be created. We will use the kernel 449<e>initial root disk</e> (initrd) will be created. We will use the kernel
379and initrd when configuring a boot loader later in this document. Write 450and initrd when configuring a boot loader later in this document. Write
380down the names of the kernel and initrd as you will need it when writing 451down the names of the kernel and initrd as you will need it when writing
381the bootloader configuration file. The initrd will be started immediately after 452the bootloader configuration file. The initrd will be started immediately after
382booting to perform hardware autodetection (just like on the Installation CD) 453booting to perform hardware autodetection (just like on the Installation CD)
383before your "real" system starts up. Be sure to also copy down the required 454before your "real" system starts up. Be sure to also copy down the required
384boot arguments, these are required for a sucessful boot with genkernel. 455boot arguments, these are required for a successful boot with genkernel.
385</p> 456</p>
386 457
387<pre caption="Checking the created kernel image name and initrd"> 458<pre caption="Checking the created kernel image name and initrd">
388# <i>ls /boot/kernel* /boot/initrd*</i> 459# <i>ls /boot/kernel* /boot/initrd*</i>
389</pre> 460</pre>
399# <i>emerge coldplug</i> 470# <i>emerge coldplug</i>
400# <i>rc-update add coldplug boot</i> 471# <i>rc-update add coldplug boot</i>
401</pre> 472</pre>
402 473
403<p> 474<p>
404If you want your system to react to hotplugging events, you will need to install
405and setup <c>hotplug</c> as well:
406</p>
407
408<pre caption="Emerging and enabling hotplug">
409# <i>emerge hotplug</i>
410# <i>rc-update add hotplug default</i>
411</pre>
412
413<p>
414Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>. 475Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>.
415</p> 476</p>
416 477
417</body> 478</body>
418</section> 479</section>
419 480
420</sections> 481</sections>
421

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

  ViewVC Help
Powered by ViewVC 1.1.20