/[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.1 - (hide annotations) (download) (as text)
Fri Apr 2 08:14:45 2004 UTC (10 years, 5 months ago) by swift
Branch: MAIN
File MIME type: application/xml
#42823 - Separate architecture specific instructions in separate handbooks

1 swift 1.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: /home/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-install-ppc-kernel.xml,v 1.3 2004/04/01 08:10:42 swift Exp $ -->
8    
9     <sections>
10     <section>
11     <title>Timezone</title>
12     <body>
13    
14     <p>
15     You first need to select your timezone so that your system knows where it is
16     located. Look for your timezone in <path>/usr/share/zoneinfo</path>, then make a
17     symlink to <path>/etc/localtime</path> using <c>ln</c>:
18     </p>
19    
20     <pre caption="Setting the timezone information">
21     # <i>ls /usr/share/zoneinfo</i>
22     <comment>(Suppose you want to use GMT)</comment>
23     # <i>ln -sf /usr/share/zoneinfo/GMT /etc/localtime</i>
24     </pre>
25    
26     </body>
27     </section>
28     <section>
29     <title>Installing the Sources</title>
30     <subsection>
31     <title>Choosing a Kernel</title>
32     <body>
33    
34     <p>
35     The core around which all distributions are built is the Linux kernel. It is the
36     layer between the user programs and your system hardware. Gentoo provides its
37     users several possible kernel sources. A full listing with description is
38     available at the <uri link="/doc/en/gentoo-kernel.xml">Gentoo Kernel
39     Guide</uri>.
40     </p>
41    
42     <p>
43     For PPC you must use the <c>ppc-sources</c>. So let's continue with
44     <c>emerge</c>'ing the kernel sources:
45     </p>
46    
47     <pre caption="Installing a kernel source">
48     # <i>emerge ppc-sources</i>
49     </pre>
50    
51     <p>
52     When you take a look in <path>/usr/src</path> you should see a symlink called
53     <path>linux</path> pointing to your kernel source:
54     </p>
55    
56     <pre caption="Viewing the kernel source symlink">
57     # <i>ls -l /usr/src/linux</i>
58     lrwxrwxrwx 1 root root 12 Oct 13 11:04 /usr/src/linux -&gt; linux-2.4.24
59     </pre>
60    
61     <p>
62     If this isn't the case (i.e. the symlink points to a different kernel source)
63     change the symlink before you continue:
64     </p>
65    
66     <pre caption="Changing the kernel source symlink">
67     # <i>rm /usr/src/linux &amp;&amp; ln -s /usr/src/linux-2.4.24 /usr/src/linux</i>
68     </pre>
69    
70     <p>
71     Now it is time to configure and compile your kernel source. All architectures
72     can use <c>genkernel</c> for this, which will build a generic kernel as used
73     by the LiveCD. We explain the "manual" configuration first though, as it is
74     the best way to optimize your environment.
75     </p>
76    
77     <p>
78     If you want to manually configure your kernel, continue now with <uri
79     link="#manual">Default: Manual Configuration</uri>. If you want to use
80     <c>genkernel</c> you should read <uri link="#genkernel">Alternative: Using
81     genkernel</uri> instead.
82     </p>
83    
84     </body>
85     </subsection>
86     </section>
87     <section id="manual">
88     <title>Default: Manual Configuration</title>
89     <subsection>
90     <title>Introduction</title>
91     <body>
92    
93     <p>
94     Manually configuring a kernel is often seen as the most difficult course every
95     Linux users ever has to go through. Nothing is less true -- after configuring a
96     couple of kernels you don't even remember that it was difficult ;)
97     </p>
98    
99     <p>
100     However, one thing <e>is</e> true: you must know your system when you start
101     configuring a kernel manually. Most information can be gathered by viewing the
102     contents of <path>/proc/pci</path> (or by using <c>lspci</c> if available). You
103     can also run <c>lsmod</c> to see what kernel modules the LiveCD uses (it might
104     provide you with a nice hint on what to enable).
105     </p>
106    
107     <p>
108     Now go to your kernel source directory and execute <c>make menuconfig</c>. This
109     will fire up an ncurses-based configuration menu.
110     </p>
111    
112     <pre caption="Invoking menuconfig">
113     # <i>cd /usr/src/linux</i>
114     # <i>make menuconfig</i>
115     </pre>
116    
117     <p>
118     You will be greeted with several configuration sections. We'll first list some
119     options you must activate (otherwise Gentoo will not function, or not function
120     properly without additional tweaks).
121     </p>
122    
123     </body>
124     </subsection>
125     <subsection>
126     <title>Activating Required Options</title>
127     <body>
128    
129     <p>
130     First of all, activate the use of development and experimental code/drivers.
131     You need this, otherwise some very important code/drivers won't show up:
132     </p>
133    
134     <pre caption="Selecting experimental code/drivers">
135     Code maturity level options ---&gt;
136     [*] Prompt for development and/or incomplete code/drivers
137     </pre>
138    
139     <p>
140     Now go to <c>File Systems</c> and select support for the filesystems you use.
141     <e>Don't</e> compile them as modules, otherwise your Gentoo system will not be
142     able to mount your partitions. Also select <c>Virtual memory</c>, <c>/proc
143     file system</c>, <c>/dev file system</c> + <c>Automatically mount at boot</c>:
144     </p>
145    
146     <pre caption="Selecting necessary file systems">
147     File systems ---&gt;
148     [*] Virtual memory file system support (former shm fs)
149     [*] /proc file system support
150     [*] /dev file system support (EXPERIMENTAL)
151     [*] Automatically mount at boot
152    
153     <comment>(Deselect the following unless you have a 2.6 kernel)</comment>
154     [ ] /dev/pts file system for Unix98 PTYs
155    
156     <comment>(Select one or more of the following options as needed by your system)</comment>
157     &lt;*&gt; Reiserfs support
158     &lt;*&gt; Ext3 journalling file system support
159     &lt;*&gt; JFS filesystem support
160     &lt;*&gt; Second extended fs support
161     &lt;*&gt; XFS filesystem support
162     </pre>
163    
164     <note>
165     Users of a 2.6 kernel will find some of the mentioned options under <c>Pseudo
166     filesystems</c> which is a subpart of <c>File systems</c>.
167     </note>
168    
169     <p>
170     If you are using PPPoE to connect to the Internet or you are using a dial-up
171     modem, you will need the following options in the kernel:
172     </p>
173    
174     <pre caption="Selecting PPPoE necessary drivers">
175     Network device support ---&gt;
176     &lt;*&gt; PPP (point-to-point protocol) support
177     &lt;*&gt; PPP support for async serial ports
178     &lt;*&gt; PPP support for sync tty ports
179     </pre>
180    
181     <note>
182     Users of a 2.6 kernel will find the mentioned options under <c>Networking
183     support</c> which is a subpart of <c>Device Drivers</c>.
184     </note>
185    
186     <p>
187     The two compression options won't harm but are not definitely needed, neither
188     does the <c>PPP over Ethernet</c> option, that might only be used by
189     <c>rp-pppoe</c> when configured to do kernel mode PPPoE.
190     </p>
191    
192     <note>
193     Users of a 2.6 kernel will find the mentioned options under <c>Device
194     Drivers</c>.
195     </note>
196    
197     <p>
198     If you require it, don't forget to include support in the kernel for your
199     ethernet card.
200     </p>
201    
202     <p>
203     Disable ADB raw keycodes:
204     </p>
205    
206     <pre caption="Disabling ADB raw keycodes">
207     Macintosh Device Drivers ---&gt;
208     [ ] Support for ADB raw keycodes
209     </pre>
210    
211     <p>
212     Also choose the correct RTC support (<e>disable</e> the <c>Enhanced RTC</c>
213     option):
214     </p>
215    
216     <pre caption="Activating the correct RTC option">
217     Character devices ---&gt;
218     [ ] Enhanced RTC
219    
220     General setup ---&gt;
221     [*] Support for /dev/rtc
222     </pre>
223    
224     <p>
225     Users of OldWorld machines will want HFS support so they can copy compiled
226     kernels to the MacOS 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 <c>make dep &amp;&amp; make vmlinux modules
248     modules_install</c>:
249     </p>
250    
251     <pre caption="Compiling the kernel">
252     # <i>make dep &amp;&amp; make vmlinux modules modules_install</i>
253     </pre>
254    
255     <p>
256     When the kernel is done compiling, copy over the kernel image to
257     <path>/boot</path>.
258     </p>
259    
260     <pre caption="Installing the kernel">
261     # <i>cp vmlinux /boot/kernel-2.4.24</i>
262     # <i>cp System.map /boot/System.map-2.4.24</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.4.24</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="genkernel">
283     <title>Alternative: Using genkernel</title>
284     <body>
285    
286     <p>
287     If you are reading this section, you have chosen to use our <c>genkernel</c>
288     script to configure your kernel for you.
289     </p>
290    
291     <p>
292     Now that your kernel source tree is installed, it's now time to compile your
293     kernel by using our <c>genkernel</c> script to automatically build a kernel for
294     you. <c>genkernel</c> works by configuring a kernel nearly identically to the
295     way our LiveCD kernel is configured. This means that when you use
296     <c>genkernel</c> to build your kernel, your system will generally detect all
297     your hardware at boot-time, just like our Live CD does. Because genkernel
298     doesn't require any manual kernel configuration, it is an ideal solution for
299     those users who may not be comfortable compiling their own kernels.
300     </p>
301    
302     <p>
303     Now, let's see how to use genkernel. First, emerge the genkernel ebuild:
304     </p>
305    
306     <pre caption="Emerging genkernel">
307     # <i>emerge genkernel</i>
308     </pre>
309    
310     <p>
311     Now, compile your kernel sources by running <c>genkernel all</c>.
312     Be aware though, as <c>genkernel</c> compiles a kernel that supports almost all
313     hardware, this compilation will take quite a while to finish!
314     </p>
315    
316     <p>
317     Note that, if your boot partition doesn't use ext2 or ext3 as filesystem you
318     need to manually configure your kernel using <c>genkernel --menuconfig all</c>
319     and add support for your filesystem <e>in</e> the kernel (i.e. <e>not</e> as a
320     module).
321     </p>
322    
323     <pre caption="Running genkernel">
324     # <i>genkernel all</i>
325     GenKernel v3.0.1_beta10
326     * ARCH: ppc
327     * KERNEL VER: 2.4.24
328     * kernel: configuring source
329     * kernel: running mrproper
330     <comment>(Output removed to increase readability)</comment>
331     * Kernel compiled successfully!
332     * Required Kernel Params:
333     * : root=/dev/ram0 init=/linuxrc real_root=/dev/$ROOT
334     * where $ROOT is the devicenode for your root partition as
335     * you should have specified in /etc/fstab
336     *
337     * You MUST tell your bootloader to use the generated initrd
338     *
339     * Recommended Kernel Params:
340     * : vga=0x317 splash=verbose
341     *
342     * Do NOT report kernel bugs (configs included) as genkernel bugs.
343     * Make sure you have the latest genkernel before reporting bugs
344     *
345     * For more info see /usr/share/genkernel/README
346     </pre>
347    
348     <p>
349     Once <c>genkernel</c> completes, a kernel, full set of modules and
350     <e>initial root disk</e> (initrd) will be created. We will use the kernel
351     and initrd when configuring a boot loader later in this document. Write
352     down the names of the kernel and initrd as you will need it when writing
353     the bootloader configuration file. The initrd will be started immediately after
354     booting to perform hardware autodetection (just like on the Live CD) before
355     your "real" system starts up.
356     </p>
357    
358     <pre caption="Checking the created kernel image name and initrd">
359     # <i>ls /boot/kernel* /boot/initrd*</i>
360     </pre>
361    
362     <p>
363     Now, let's perform one more step to get our system to be more like the Live
364     CD -- let's emerge <c>hotplug</c>. While the initrd autodetects hardware that
365     is needed to boot your system, <c>hotplug</c> autodetects everything else.
366     To emerge and enable <c>hotplug</c>, type the following:
367     </p>
368    
369     <pre caption="Emerging and enabling hotplug">
370     # <i>emerge hotplug</i>
371     # <i>rc-update add hotplug default</i>
372     </pre>
373    
374     </body>
375     </section>
376     <section id="kernel_modules">
377     <title>Installing Separate Kernel Modules</title>
378     <subsection>
379     <title>Installing Extra Modules</title>
380     <body>
381    
382     <p>
383     If appropriate, you should emerge ebuilds for any additional hardware that is
384     on your system. Here is a list of kernel-related ebuilds that you could emerge:
385     </p>
386    
387     <table>
388     <tcolumn width="1in"/>
389     <tcolumn width="4in"/>
390     <tcolumn width="2in"/>
391     <tr>
392     <th>Ebuild</th>
393     <th>Purpose</th>
394     <th>Command</th>
395     </tr>
396     <tr>
397     <ti>xfree-drm</ti>
398     <ti>
399     Accelerated graphics for ATI Radeon up to 9200, Rage128, Matrox, Voodoo and
400     other cards for XFree86. Please check the <c>IUSE_VIDEO_CARDS</c> variable
401     in the <path>/usr/portage/x11-base/xfree-drm</path> ebuilds to see what you
402     need to fill in as <c>yourcard</c>.
403     </ti>
404     <ti><c>VIDEO_CARDS="yourcard" emerge xfree-drm</c></ti>
405     </tr>
406     </table>
407    
408     <p>
409     Beware though, some of these ebuilds might deal with big dependencies. To verify
410     what packages will be installed by emerging an ebuild, use <c>emerge
411     --pretend</c>. For instance, for the <c>xfree-drm</c> package:
412     </p>
413    
414     <pre caption="View full installation package listing">
415     # <i>emerge --pretend xfree-drm</i>
416     </pre>
417    
418     </body>
419     </subsection>
420     <subsection>
421     <title>Configuring the Modules</title>
422     <body>
423    
424     <p>
425     You should list the modules you want automatically loaded in
426     <path>/etc/modules.autoload.d/kernel-2.4</path> (or <path>kernel-2.6</path>).
427     You can add extra options to the modules too if you want.
428     </p>
429    
430     <p>
431     To view all available modules, run the following <c>find</c> command. Don't
432     forget to substitute "&lt;kernel version&gt;" with the version of the kernel you
433     just compiled:
434     </p>
435    
436     <pre caption="Viewing all available modules">
437     # <i>find /lib/modules/&lt;kernel version&gt;/ -type f -iname '*.o' -or -iname '*.ko'</i>
438     </pre>
439    
440     <p>
441     For instance, to automatically load the <c>3c59x.o</c> module, edit the
442     <path>kernel-2.4</path> or <path>kernel-2.6</path> file and enter the module
443     name in it.
444     </p>
445    
446     <pre caption="Editing /etc/modules.autoload.d/kernel-2.4">
447     <comment>(Example for 2.4 kernels)</comment>
448     # <i>nano -w /etc/modules.autoload.d/kernel-2.4</i>
449     </pre>
450    
451     <pre caption="/etc/modules.autoload.d/kernel-2.4 or kernel-2.6">
452     3c59x
453     </pre>
454    
455     <p>
456     Now run <c>modules-update</c> to commit your changes to the
457     <path>/etc/modules.conf</path> file:
458     </p>
459    
460     <pre caption="Running modules-update">
461     # <i>modules-update</i>
462     </pre>
463    
464     <p>
465     Continue the installation with <uri link="?part=1&amp;chap=8">Configuring
466     your System</uri>.
467     </p>
468    
469     </body>
470     </subsection>
471     </section>
472     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20