/[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.26 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.26 2005/06/02 17:18:54 swift 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.6</version> 11<version>2.11</version>
12<date>2005-06-02</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>lscpi</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>lscpi</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.
150<p> 152<p>
151First of all, activate the use of development and experimental code/drivers. 153First of all, activate the use of development and experimental code/drivers.
152You need this, otherwise some very important code/drivers won't show up: 154You need this, otherwise some very important code/drivers won't show up:
153</p> 155</p>
154 156
155<pre caption="Selecting experimental code/drivers"> 157<pre caption="Selecting experimental code/drivers, General setup">
156Code maturity level options ---&gt; 158Code maturity level options ---&gt;
157 [*] Prompt for development and/or incomplete code/drivers 159 [*] Prompt for development and/or incomplete code/drivers
160General setup --->
161 [*] Support for hot-pluggable devices
158</pre> 162</pre>
159 163
160<p> 164<p>
161Now go to <c>File Systems</c> and select support for the filesystems you use. 165Now go to <c>File Systems</c> and select support for the filesystems you use.
162<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be 166<e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
170 [*] /proc file system support 174 [*] /proc file system support
171 [ ] /dev file system support (OBSOLETE) 175 [ ] /dev file system support (OBSOLETE)
172 [*] Virtual memory file system support (former shm fs) 176 [*] Virtual memory file system support (former shm fs)
173 177
174<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
175 &lt;*&gt; Reiserfs support 181 &lt;*&gt; Reiserfs support
176 &lt;*&gt; Ext3 journalling file system support
177 &lt;*&gt; Second extended fs support
178 &lt;*&gt; XFS filesystem support 182 &lt;*&gt; XFS filesystem support
179</pre> 183</pre>
180 184
181<p> 185<p>
182If 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
201If 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
202ethernet card. 206ethernet card.
203</p> 207</p>
204 208
205<p> 209<p>
206Users 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
207kernels 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
208needed for the special Apple_Bootstrap partition: 212users require it for configuring the special Apple_Bootstrap partition:
209</p> 213</p>
210 214
211<pre caption="Activating HFS support"> 215<pre caption="Activating HFS support">
212File Systems ---&gt; 216File Systems ---&gt;
213 [*] HFS Support 217 [*] HFS Support
223Platform options ---&gt; 227Platform options ---&gt;
224 [ ] Preemptible Kernel 228 [ ] Preemptible Kernel
225</pre> 229</pre>
226 230
227<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>
228When you're done configuring your kernel, continue with <uri 286When you're done configuring your kernel, continue with <uri
229link="#compiling">Compiling and Installing</uri>. 287link="#compiling">Compiling and Installing</uri>.
230</p> 288</p>
231 289
232</body> 290</body>
239Now 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
240the configuration and run the commands which will compile the kernel: 298the configuration and run the commands which will compile the kernel:
241</p> 299</p>
242 300
243<pre caption="Compiling the kernel"> 301<pre caption="Compiling the kernel">
244# <i>make all &amp;&amp; make modules_install</i> 302# <i>make &amp;&amp; make modules_install</i>
245</pre> 303</pre>
246 304
247<p> 305<p>
248When the kernel has finished compiling, copy the kernel image to 306When the kernel has finished compiling, copy the kernel image to
249<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).
250</p> 308</p>
251 309
252<pre caption="Installing the kernel"> 310<pre caption="Installing the kernel">
253<comment>replace 2.6.10 with your kernel-version</comment> 311<comment>replace 2.6.12 with your kernel-version</comment>
254(Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.10</i> 312(Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.12</i>
255(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>
256</pre> 314</pre>
257 315
258<p> 316<p>
259It is also wise to copy over your kernel configuration file to 317It is also wise to copy over your kernel configuration file to
260<path>/boot</path>, just in case :) 318<path>/boot</path>, just in case :)
261</p> 319</p>
262 320
263<pre caption="Backing up your kernel configuration"> 321<pre caption="Backing up your kernel configuration">
264# <i>cp .config /boot/config-2.6.10-gentoo-r8</i> 322# <i>cp .config /boot/config-2.6.12-gentoo-r4</i>
265</pre> 323</pre>
266 324
267<p> 325<p>
268Now continue with <uri link="#kernel_modules">Installing Separate Kernel 326Now continue with <uri link="#kernel_modules">Installing Separate Kernel
269Modules</uri>. 327Modules</uri>.
279<body> 337<body>
280 338
281<p> 339<p>
282You should list the modules you want automatically loaded in 340You should list the modules you want automatically loaded in
283<path>/etc/modules.autoload.d/kernel-2.6</path>. 341<path>/etc/modules.autoload.d/kernel-2.6</path>.
284You can add extra options to the modules too if you want. 342You can add extra options to the modules too if needed.
285</p> 343</p>
286 344
287<p> 345<p>
288To 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
289forget 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
329Now 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
330kernel 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
331you. <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
332way 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
333<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
334your hardware at boot-time, just like our Installation CD does. Because genkernel 392your hardware at boot-time, just like our Installation CD does.
335doesn't require any manual kernel configuration, it is an ideal solution for 393Because genkernel doesn't require any manual kernel configuration, it is an
336those users who may not be comfortable compiling their own kernels. 394ideal solution for those users who may not be comfortable compiling their own
395kernels.
337</p> 396</p>
338 397
339<p> 398<p>
340Now, 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:
341</p> 400</p>
352<pre caption="Copying over the Installation CD kernel config"> 411<pre caption="Copying over the Installation CD kernel config">
353# <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>
354</pre> 413</pre>
355 414
356<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>
357Now, compile your kernel sources by running <c>genkernel --udev all</c>. 423Now, compile your kernel sources by running <c>genkernel --genzimage all</c>.
358Be 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
359hardware, 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!
360</p> 428</p>
361 429
362<p> 430<p>
363Note 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
364or 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
365<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
366the 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
367want 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.
368</p> 437</p>
369 438
370<pre caption="Running genkernel"> 439<pre caption="Running genkernel">
371# <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>
372</pre> 445</pre>
373 446
374<p> 447<p>
375Once <c>genkernel</c> completes, a kernel, full set of modules and 448Once <c>genkernel</c> completes, a kernel, full set of modules and
376<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
377and initrd when configuring a boot loader later in this document. Write 450and initrd when configuring a boot loader later in this document. Write
378down 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
379the bootloader configuration file. The initrd will be started immediately after 452the bootloader configuration file. The initrd will be started immediately after
380booting to perform hardware autodetection (just like on the Installation CD) 453booting to perform hardware autodetection (just like on the Installation CD)
381before 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
382boot arguments, these are required for a sucessful boot with genkernel. 455boot arguments, these are required for a successful boot with genkernel.
383</p> 456</p>
384 457
385<pre caption="Checking the created kernel image name and initrd"> 458<pre caption="Checking the created kernel image name and initrd">
386# <i>ls /boot/kernel* /boot/initrd*</i> 459# <i>ls /boot/kernel* /boot/initrd*</i>
387</pre> 460</pre>
397# <i>emerge coldplug</i> 470# <i>emerge coldplug</i>
398# <i>rc-update add coldplug boot</i> 471# <i>rc-update add coldplug boot</i>
399</pre> 472</pre>
400 473
401<p> 474<p>
402If you want your system to react to hotplugging events, you will need to install
403and setup <c>hotplug</c> as well:
404</p>
405
406<pre caption="Emerging and enabling hotplug">
407# <i>emerge hotplug</i>
408# <i>rc-update add hotplug default</i>
409</pre>
410
411<p>
412Now 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>.
413</p> 476</p>
414 477
415</body> 478</body>
416</section> 479</section>
417 480
418</sections> 481</sections>
419

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

  ViewVC Help
Powered by ViewVC 1.1.20