/[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.33 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.33 2005/08/06 19:03:31 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.10</version> 11<version>2.11</version>
12<date>2005-08-06</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
222</p> 224</p>
223 225
224<pre caption="Ensure the Preemptible Kernel Option is Off"> 226<pre caption="Ensure the Preemptible Kernel Option is Off">
225Platform options ---&gt; 227Platform options ---&gt;
226 [ ] Preemptible Kernel 228 [ ] Preemptible Kernel
229</pre>
230
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
227</pre> 257</pre>
228 258
229<p> 259<p>
230Do not turn off kernel framebuffer support as it is required for a successful 260Do not turn off kernel framebuffer support as it is required for a successful
231boot. If you are using an NVIDIA based chipset, you should use the OpenFirmware 261boot. If you are using an NVIDIA based chipset, you should use the OpenFirmware
267Now 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
268the configuration and run the commands which will compile the kernel: 298the configuration and run the commands which will compile the kernel:
269</p> 299</p>
270 300
271<pre caption="Compiling the kernel"> 301<pre caption="Compiling the kernel">
272# <i>make all &amp;&amp; make modules_install</i> 302# <i>make &amp;&amp; make modules_install</i>
273</pre> 303</pre>
274 304
275<p> 305<p>
276When the kernel has finished compiling, copy the kernel image to 306When the kernel has finished compiling, copy the kernel image to
277<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).
278</p> 308</p>
279 309
280<pre caption="Installing the kernel"> 310<pre caption="Installing the kernel">
281<comment>replace 2.6.10 with your kernel-version</comment> 311<comment>replace 2.6.12 with your kernel-version</comment>
282(Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.10</i> 312(Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.12</i>
283(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>
284</pre> 314</pre>
285 315
286<p> 316<p>
287It is also wise to copy over your kernel configuration file to 317It is also wise to copy over your kernel configuration file to
288<path>/boot</path>, just in case :) 318<path>/boot</path>, just in case :)
289</p> 319</p>
290 320
291<pre caption="Backing up your kernel configuration"> 321<pre caption="Backing up your kernel configuration">
292# <i>cp .config /boot/config-2.6.10-gentoo-r8</i> 322# <i>cp .config /boot/config-2.6.12-gentoo-r4</i>
293</pre> 323</pre>
294 324
295<p> 325<p>
296Now continue with <uri link="#kernel_modules">Installing Separate Kernel 326Now continue with <uri link="#kernel_modules">Installing Separate Kernel
297Modules</uri>. 327Modules</uri>.
307<body> 337<body>
308 338
309<p> 339<p>
310You should list the modules you want automatically loaded in 340You should list the modules you want automatically loaded in
311<path>/etc/modules.autoload.d/kernel-2.6</path>. 341<path>/etc/modules.autoload.d/kernel-2.6</path>.
312You can add extra options to the modules too if you want. 342You can add extra options to the modules too if needed.
313</p> 343</p>
314 344
315<p> 345<p>
316To 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
317forget 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
357Now 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
358kernel 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
359you. <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
360way 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
361<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
362your hardware at boot-time, just like our Installation CD does. Because genkernel 392your hardware at boot-time, just like our Installation CD does.
363doesn't require any manual kernel configuration, it is an ideal solution for 393Because genkernel doesn't require any manual kernel configuration, it is an
364those users who may not be comfortable compiling their own kernels. 394ideal solution for those users who may not be comfortable compiling their own
395kernels.
365</p> 396</p>
366 397
367<p> 398<p>
368Now, 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:
369</p> 400</p>
380<pre caption="Copying over the Installation CD kernel config"> 411<pre caption="Copying over the Installation CD kernel config">
381# <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>
382</pre> 413</pre>
383 414
384<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>
385Now, compile your kernel sources by running <c>genkernel --udev all</c>. 423Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
386Be 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
387hardware, 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!
388</p> 428</p>
389 429
390<p> 430<p>
391Note 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
392or 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
393<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
394the 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
395want 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.
396</p> 437</p>
397 438
398<pre caption="Running genkernel"> 439<pre caption="Running genkernel">
399# <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>
400</pre> 445</pre>
401 446
402<p> 447<p>
403Once <c>genkernel</c> completes, a kernel, full set of modules and 448Once <c>genkernel</c> completes, a kernel, full set of modules and
404<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
405and initrd when configuring a boot loader later in this document. Write 450and initrd when configuring a boot loader later in this document. Write
406down 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
407the bootloader configuration file. The initrd will be started immediately after 452the bootloader configuration file. The initrd will be started immediately after
408booting to perform hardware autodetection (just like on the Installation CD) 453booting to perform hardware autodetection (just like on the Installation CD)
409before 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
410boot arguments, these are required for a sucessful boot with genkernel. 455boot arguments, these are required for a successful boot with genkernel.
411</p> 456</p>
412 457
413<pre caption="Checking the created kernel image name and initrd"> 458<pre caption="Checking the created kernel image name and initrd">
414# <i>ls /boot/kernel* /boot/initrd*</i> 459# <i>ls /boot/kernel* /boot/initrd*</i>
415</pre> 460</pre>
432 477
433</body> 478</body>
434</section> 479</section>
435 480
436</sections> 481</sections>
437

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

  ViewVC Help
Powered by ViewVC 1.1.20