/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.22 - (show annotations) (download) (as text)
Mon Apr 11 11:57:05 2005 UTC (9 years, 4 months ago) by josejx
Branch: MAIN
Changes since 1.21: +5 -4 lines
File MIME type: application/xml
Added genkernel specifics.

1 <?xml version='1.0' encoding='UTF-8'?>
2 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3
4 <!-- The content of this document is licensed under the CC-BY-SA license -->
5 <!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
6
7 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc-kernel.xml,v 1.21 2005/03/29 14:08:29 swift Exp $ -->
8
9 <sections>
10
11 <version>2.3</version>
12 <date>2005-04-11</date>
13
14 <section>
15 <title>Timezone</title>
16 <body>
17
18 <p>
19 You first need to select your timezone so that your system knows where it is
20 located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then make a
21 symlink to <path>/etc/localtime</path> using <c>ln</c>:
22 </p>
23
24 <pre caption="Setting the timezone information">
25 # <i>ls /usr/share/zoneinfo</i>
26 <comment>(Suppose you want to use GMT)</comment>
27 # <i>ln -sf /usr/share/zoneinfo/GMT /etc/localtime</i>
28 </pre>
29
30 </body>
31 </section>
32 <section>
33 <title>Installing the Sources</title>
34 <subsection>
35 <title>Choosing a Kernel</title>
36 <body>
37
38 <p>
39 The core around which all distributions are built is the Linux kernel. It is the
40 layer between the user programs and your system hardware. Gentoo provides its
41 users several possible kernel sources. A full listing with description is
42 available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
43 Guide</uri>.
44 </p>
45
46 <p>
47 For PPC you can choose between <c>vanilla-sources</c> and
48 <c>gentoo-sources</c> (both 2.6 kernels). The latter is available when you
49 perform a networkless installation. Beside those there is a special
50 kernel-2.6-patchset for the Pegasos: <c>pegasos-sources</c>. So let's
51 continue with <c>emerge</c>'ing the kernel sources:
52 </p>
53
54 <pre caption="Installing a kernel source">
55 # <i>emerge gentoo-sources</i>
56 </pre>
57
58 <note>
59 The PowerPC sources are based on a 2.6.10-kernel with security patches from
60 2.6.11 backported. As the time of the release the 2.6.11 kernel produced
61 several problems on different PowerPC machines.
62 </note>
63
64 <p>
65 When you take a look in <path>/usr/src</path> you should see a symlink called
66 <path>linux</path> pointing to your kernel source. We will assume the kernel
67 source installed is <c>gentoo-sources-2.6.10-r8</c>:
68 </p>
69
70 <pre caption="Viewing the kernel source symlink">
71 # <i>ls -l /usr/src/linux</i>
72 lrwxrwxrwx 1 root root 22 Mar 18 16:23 /usr/src/linux -&gt; linux-2.6.10-gentoo-r8
73 </pre>
74
75 <p>
76 If 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
78 right kernel:
79 </p>
80
81 <pre caption="Changing the kernel source symlink">
82 # <i>rm /usr/src/linux</i>
83 # <i>cd /usr/src</i>
84 # <i>ln -s linux-2.6.10-gentoo-r8 linux</i>
85 </pre>
86
87 <p>
88 Now it is time to configure and compile your kernel source. You
89 can use <c>genkernel</c> for this, which will build a generic kernel as used
90 by the Installation CD. We explain the "manual" configuration first though, as
91 it is the best way to optimize your environment.
92 </p>
93
94 <p>
95 If you want to manually configure your kernel, continue now with <uri
96 link="#manual">Default: Manual Configuration</uri>. If you want to use
97 <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
98 genkernel</uri> instead.
99 </p>
100
101 </body>
102 </subsection>
103 </section>
104 <section id="manual">
105 <title>Default: Manual Configuration</title>
106 <subsection>
107 <title>Introduction</title>
108 <body>
109
110 <p>
111 Manually configuring a kernel is often seen as the most difficult procedure a
112 Linux user ever has to perform. Nothing is less true -- after configuring a
113 couple of kernels you don't even remember that it was difficult ;)
114 </p>
115
116 <p>
117 However, one thing <e>is</e> true: you must know your system when you start
118 configuring a kernel manually. Most information can be gathered by viewing the
119 contents of <path>/proc/pci</path> (or by using <c>lspci</c> if available). You
120 can also run <c>lsmod</c> to see what kernel modules the Installation CD uses
121 (it might provide you with a nice hint on what to enable).
122 </p>
123
124 <p>
125 Now go to your kernel source directory and execute <c>make menuconfig</c>. This
126 will fire up an ncurses-based configuration menu.
127 </p>
128
129 <pre caption="Invoking menuconfig">
130 # <i>cd /usr/src/linux</i>
131 # <i>make menuconfig</i>
132 </pre>
133
134 <p>
135 You will be greeted with several configuration sections. We'll first list some
136 options you must activate (otherwise Gentoo will not function, or not function
137 properly without additional tweaks).
138 </p>
139
140 </body>
141 </subsection>
142 <subsection>
143 <title>Activating Required Options</title>
144 <body>
145
146 <p>
147 First of all, activate the use of development and experimental code/drivers.
148 You need this, otherwise some very important code/drivers won't show up:
149 </p>
150
151 <pre caption="Selecting experimental code/drivers">
152 Code maturity level options ---&gt;
153 [*] Prompt for development and/or incomplete code/drivers
154 </pre>
155
156 <p>
157 Now go to <c>File Systems</c> and select support for the filesystems you use.
158 <e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
159 able to mount your partitions. Also select <c>/proc file system</c> and
160 <c>Virtual memory</c>. Do <e>not</e> select the <c>/dev file system</c>.
161 </p>
162
163 <pre caption="Selecting necessary file systems">
164 File systems ---&gt;
165 Pseudo Filesystems ---&gt;
166 [*] /proc file system support
167 [ ] /dev file system support (OBSOLETE)
168 [*] Virtual memory file system support (former shm fs)
169
170 <comment>(Select one or more of the following options as needed by your system)</comment>
171 &lt;*&gt; Reiserfs support
172 &lt;*&gt; Ext3 journalling file system support
173 &lt;*&gt; Second extended fs support
174 &lt;*&gt; XFS filesystem support
175 </pre>
176
177 <p>
178 If you are using PPPoE to connect to the Internet or you are using a dial-up
179 modem, you will need the following options in the kernel:
180 </p>
181
182 <pre caption="Selecting PPPoE necessary drivers">
183 Device Drivers ---&gt;
184 Networking support ---&gt;
185 &lt;*&gt; PPP (point-to-point protocol) support
186 &lt;*&gt; PPP support for async serial ports
187 &lt;*&gt; PPP support for sync tty ports
188 </pre>
189
190 <p>
191 The two compression options won't harm but are not definitely needed, neither
192 does the <c>PPP over Ethernet</c> option, that might only be used by
193 <c>rp-pppoe</c> when configured to do kernel mode PPPoE.
194 </p>
195
196 <p>
197 If you require it, don't forget to include support in the kernel for your
198 ethernet card.
199 </p>
200
201 <p>
202 Disable ADB raw keycodes:
203 </p>
204
205 <pre caption="Disabling ADB raw keycodes">
206 Macintosh Device Drivers ---&gt;
207 [ ] Support for ADB raw keycodes
208 </pre>
209
210 <p>
211 Also choose the correct RTC support (<e>disable</e> the <c>Enhanced RTC</c>
212 option):
213 </p>
214
215 <pre caption="Activating the correct RTC option">
216 Character devices ---&gt;
217 [ ] Enhanced RTC
218
219 General setup ---&gt;
220 [*] Support for /dev/rtc
221 </pre>
222
223 <p>
224 Users of OldWorld machines will want HFS support so they can copy compiled
225 kernels to the MacOS partition. This applies also to NewWorld machines as it is
226 needed for the special Apple_Bootstrap partition:
227 </p>
228
229 <pre caption="Activating HFS support">
230 File Systems ---&gt;
231 [*] HFS Support
232 </pre>
233
234 <p>
235 When you're done configuring your kernel, continue with <uri
236 link="#compiling">Compiling and Installing</uri>.
237 </p>
238
239 </body>
240 </subsection>
241 <subsection id="compiling">
242 <title>Compiling and Installing</title>
243 <body>
244
245 <p>
246 Now that your kernel is configured, it is time to compile and install it. Exit
247 the configuration and run the commands which will compile the kernel:
248 </p>
249
250 <pre caption="Compiling the kernel">
251 # <i>make all &amp;&amp; make modules_install</i>
252 </pre>
253
254 <p>
255 When the kernel has finished compiling, copy the kernel image to
256 <path>/boot</path> (be sure that it is mounted properly on the Pegasos).
257 </p>
258
259 <pre caption="Installing the kernel">
260 <comment>replace 2.6.10 with your kernel-version</comment>
261 (Apple/IBM) # <i>cp vmlinux /boot/kernel-2.6.10</i>
262 (Pegasos) # <i>cp arch/ppc/boot/images/zImage.chrp /boot/kernel-2.6.10</i>
263 </pre>
264
265 <p>
266 It is also wise to copy over your kernel configuration file to
267 <path>/boot</path>, just in case :)
268 </p>
269
270 <pre caption="Backing up your kernel configuration">
271 # <i>cp .config /boot/config-2.6.10-gentoo-r8</i>
272 </pre>
273
274 <p>
275 Now continue with <uri link="#kernel_modules">Installing Separate Kernel
276 Modules</uri>.
277 </p>
278
279 </body>
280 </subsection>
281 </section>
282 <section id="kernel_modules">
283 <title>Installing Separate Kernel Modules</title>
284 <subsection>
285 <title>Configuring the Modules</title>
286 <body>
287
288 <p>
289 You should list the modules you want automatically loaded in
290 <path>/etc/modules.autoload.d/kernel-2.6</path>.
291 You can add extra options to the modules too if you want.
292 </p>
293
294 <p>
295 To view all available modules, run the following <c>find</c> command. Don't
296 forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
297 just compiled:
298 </p>
299
300 <pre caption="Viewing all available modules">
301 # <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
302 </pre>
303
304 <p>
305 For instance, to automatically load the <c>3c59x.o</c> module, edit the
306 <path>kernel-2.6</path> file and enter the module
307 name in it.
308 </p>
309
310 <pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
311 # <i>nano -w /etc/modules.autoload.d/kernel-2.6</i>
312 </pre>
313
314 <pre caption="/etc/modules.autoload.d/kernel-2.6">
315 3c59x
316 </pre>
317
318 <p>
319 Now run <c>modules-update</c> to commit your changes to the
320 <path>/etc/modules.conf</path> file:
321 </p>
322
323 <pre caption="Running modules-update">
324 # <i>modules-update</i>
325 </pre>
326
327 <p>
328 Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
329 your System</uri>.
330 </p>
331
332 </body>
333 </subsection>
334 </section>
335 <section id="genkernel">
336 <title>Alternative: Using genkernel</title>
337 <body>
338
339 <p>
340 If you are reading this section, you have chosen to use our <c>genkernel</c>
341 script to configure your kernel for you.
342 </p>
343
344 <p>
345 Now that your kernel source tree is installed, it's now time to compile your
346 kernel by using our <c>genkernel</c> script to automatically build a kernel for
347 you. <c>genkernel</c> works by configuring a kernel nearly identically to the
348 way our Installation CD kernel is configured. This means that when you use
349 <c>genkernel</c> to build your kernel, your system will generally detect all
350 your hardware at boot-time, just like our Installation CD does. Because genkernel
351 doesn't require any manual kernel configuration, it is an ideal solution for
352 those users who may not be comfortable compiling their own kernels.
353 </p>
354
355 <p>
356 Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
357 </p>
358
359 <pre caption="Emerging genkernel">
360 # <i>emerge genkernel</i>
361 </pre>
362
363 <p>
364 Next, copy over the kernel configuration used by the Installation CD to the
365 location where genkernel looks for the default kernel configuration:
366 </p>
367
368 <pre caption="Copying over the Installation CD kernel config">
369 # <i>zcat /proc/config.gz > /usr/share/genkernel/ppc/kernel-config-2.6</i>
370 </pre>
371
372 <p>
373 Now, compile your kernel sources by running <c>genkernel --udev all</c>.
374 Be aware though, as <c>genkernel</c> compiles a kernel that supports almost all
375 hardware, this compilation will take quite a while to finish!
376 </p>
377
378 <p>
379 Note that, if your partition where the kernel should be located doesn't use ext2
380 or ext3 as filesystem you might need to manually configure your kernel using
381 <c>genkernel --menuconfig all</c> and add support for your filesystem <e>in</e>
382 the kernel (i.e. <e>not</e> as a module). Users of EVMS2 or LVM2 will probably
383 want to add <c>--evms2</c> or <c>--lvm2</c> as argument as well.
384 </p>
385
386 <pre caption="Running genkernel">
387 # <i>genkernel --udev all</i>
388 </pre>
389
390 <p>
391 Once <c>genkernel</c> completes, a kernel, full set of modules and
392 <e>initial root disk</e> (initrd) will be created. We will use the kernel
393 and initrd when configuring a boot loader later in this document. Write
394 down the names of the kernel and initrd as you will need it when writing
395 the bootloader configuration file. The initrd will be started immediately after
396 booting to perform hardware autodetection (just like on the Installation CD)
397 before your "real" system starts up. Be sure to also copy down the required
398 boot arguments, these are required for a sucessful boot with genkernel.
399 </p>
400
401 <pre caption="Checking the created kernel image name and initrd">
402 # <i>ls /boot/kernel* /boot/initrd*</i>
403 </pre>
404
405 <p>
406 Now, let's perform one more step to get our system to be more like the
407 Installation CD -- let's emerge <c>coldplug</c>. While the initrd autodetects
408 hardware that is needed to boot your system, <c>coldplug</c> autodetects
409 everything else. To emerge and enable <c>coldplug</c>, type the following:
410 </p>
411
412 <pre caption="Emerging and enabling coldplug">
413 # <i>emerge coldplug</i>
414 # <i>rc-update add coldplug boot</i>
415 </pre>
416
417 <p>
418 If you want your system to react to hotplugging events, you will need to install
419 and setup <c>hotplug</c> as well:
420 </p>
421
422 <pre caption="Emerging and enabling hotplug">
423 # <i>emerge hotplug</i>
424 # <i>rc-update add hotplug default</i>
425 </pre>
426
427 <p>
428 Now continue with <uri link="?part=1&amp;chap=8">Configuring your System</uri>.
429 </p>
430
431 </body>
432 </section>
433
434 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20