source: chapter08/kernel-ppc.xml@ 4677870

Last change on this file since 4677870 was c2133bc, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Upgraded to DocBook 4.4 DTD

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multi-arch/BOOK@4605 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 7.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-bootable-kernel" role="wrap" arch="ppc">
7<title>Linux-&linux-version;</title>
8<?dbhtml filename="kernel.html"?>
9
10<indexterm zone="ch-bootable-kernel"><primary sortas="a-Linux">Linux</primary></indexterm>
11
12<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
13 href="../chapter08/kernel.xml"
14 xpointer="xpointer(/sect1/sect2[@role='package'])"/>
15
16<sect2 role="installation">
17<title>Installation of the kernel</title>
18
19<para>Building the kernel involves a few steps&mdash;configuration,
20compilation, and installation. Read the <filename>README</filename>
21file in the kernel source tree for alternate methods to the way this
22book configures the kernel.</para>
23
24<para>Prepare for compilation by running the following command:</para>
25
26<screen><userinput>make mrproper</userinput></screen>
27
28<para>This ensures that the kernel tree is absolutely clean. The
29kernel team recommends that this command be issued prior to each
30kernel compilation. Do not rely on the source tree being clean after
31un-tarring.</para>
32
33<para>Also, ensure that the kernel does not attempt to pass
34hotplugging events to userspace until userspace specifies that it is
35ready:</para>
36
37<screen><userinput>sed -i 's@/sbin/hotplug@/bin/true@' kernel/kmod.c</userinput></screen>
38
39<para>If, in <xref linkend="ch-scripts-console" role=","/> it was decided to
40compile the keymap into the kernel, issue the command below:</para>
41
42<screen><userinput>loadkeys -m /usr/share/kbd/keymaps/<replaceable>[path to keymap]</replaceable> &gt; \
43 drivers/char/defkeymap.c</userinput></screen>
44
45<para>For example, if using a Dutch keyboard, use
46<phrase
47condition="html"><filename>/usr/share/kbd/keymaps/i386/qwerty/nl.map.gz</filename></phrase><phrase
48condition="pdf"><filename>/usr/share/kbd/keymaps/i386/
49qwerty/nl.map.gz</filename></phrase>.</para>
50
51<para>Configure the kernel via a menu-driven interface:</para>
52
53<screen><userinput>make menuconfig</userinput></screen>
54
55<para>Alternatively, <command>make oldconfig</command>
56may be more appropriate in some
57situations. <phrase>This will build a basic system with no modules and
58ext2 support only.</phrase> See the <filename>README</filename> file for more
59information.</para>
60
61<note><para>When configuring the kernel, be sure to enable the
62<quote>Support for hot-pluggable devices</quote> option under the
63<quote>General Setup</quote> menu. This enables hotplug events that
64are used by <command>udev</command> to populate the <filename
65class="directory">/dev</filename> directory with device
66nodes.</para></note>
67
68<para>If desired, skip kernel configuration by copying the kernel
69config file, <filename>.config</filename>, from the host system
70(assuming it is available) to the unpacked <filename
71class="directory">linux-&linux-version;</filename> directory. However,
72we do not recommend this option. It is often better to explore all the
73configuration menus and create the kernel configuration from
74scratch.</para>
75
76<para>For POSIX-shared memory support, ensure that the kernel config
77option <quote>Virtual memory file system support</quote> is enabled.
78It resides within the <quote>File systems</quote> menu and is normally
79enabled by default.</para>
80
81<para>LFS bootscripts make the assumption that either both
82<quote>Support for Host-side USB</quote> and <quote>USB device
83filesystem</quote> have been compiled directly into the kernel, or
84that neither is compiled at all. Bootscripts will not work properly
85if it is a module (usbcore.ko).</para>
86
87<note><para>NPTL requires the kernel to be compiled with GCC 3.x, in
88this case &gcc-version;. Compiling with 2.95.x is known to cause failures in
89the glibc test suite, so it is not recommended to compile the kernel
90with gcc 2.95.x.</para></note>
91
92<para>Compile the kernel image and modules:</para>
93
94<screen><userinput>make</userinput></screen>
95
96<para>If using kernel modules, an
97<filename>/etc/modprobe.conf</filename> file may be needed.
98Information pertaining to modules and kernel configuration is
99located in the kernel documentation in the <filename
100class="directory">linux-&linux-version;/Documentation</filename>
101directory. The <emphasis>modprobe.conf</emphasis> man page may also be
102of interest.</para>
103
104<para>Be very careful when reading other documentation because it
105usually applies to 2.4.x kernels only. As far as we know, kernel
106configuration issues specific to Hotplug and Udev are not documented.
107The problem is that Udev will create a device node only if Hotplug or
108a user-written script inserts the corresponding module into the
109kernel, and not all modules are detectable by Hotplug. Note that
110statements like the one below in the
111<filename>/etc/modprobe.conf</filename> file do not work with
112Udev:</para>
113
114<para><screen>alias char-major-XXX some-module</screen></para>
115
116<para>Because of the complications with Hotplug, Udev, and modules, we
117strongly recommend starting with a completely non-modular kernel
118configuration, especially if this is the first time using Udev.</para>
119
120<para>Install the modules, if the kernel configuration uses them:</para>
121
122<screen><userinput>make modules_install</userinput></screen>
123
124<para>If there are many modules and very little space, consider
125stripping and compressing the modules. For most users, such
126compression is not worth the time, but if the system is pressed for
127space, see <ulink url="http://www.linux-mips.org/archives/linux-mips/2002-04/msg00031.html"/>.</para>
128
129<para>After kernel compilation is complete, additional steps are
130required to complete the installation. Some files need to be copied to
131the <filename class="directory">/boot</filename> directory.</para>
132
133<para><!--The path to the kernel image may vary depending on the platform
134being used. -->Issue the following command to install the kernel:</para>
135
136<screen><userinput>cp arch/i386/boot/bzImage /boot/lfskernel-&linux-version;</userinput></screen>
137
138<para><filename>System.map</filename> is a symbol file for the kernel.
139It maps the function entry points of every function in the kernel API,
140as well as the addresses of the kernel data structures for the running
141kernel. Issue the following command to install the map file:</para>
142
143<screen><userinput>cp System.map /boot/System.map-&linux-version;</userinput></screen>
144
145<para>The kernel configuration file <filename>.config</filename>
146produced by the <command>make menuconfig</command> step
147above contains all the configuration selections for the kernel
148that was just compiled. It is a good idea to keep this file for future
149reference:</para>
150
151<screen><userinput>cp .config /boot/config-&linux-version;</userinput></screen>
152
153<para>It is important to note that the files in the kernel source
154directory are not owned by <emphasis>root</emphasis>. Whenever a
155package is unpacked as user <emphasis>root</emphasis> (like we did
156inside chroot), the files have the user and group IDs of whatever
157they were on the packager's computer. This is usually not a problem
158for any other package to be installed because the source tree is
159removed after the installation. However, the Linux source tree is
160often retained for a long time. Because of this, there is a chance
161that whatever user ID the packager used will be assigned to somebody
162on the machine. That person would then have write access to the kernel
163source.</para>
164
165<para>If the kernel source tree is going to retained, run
166<command>chown -R 0:0</command> on the <filename
167class="directory">linux-&linux-version;</filename> directory to ensure
168all files are owned by user <emphasis>root</emphasis>.</para>
169</sect2>
170
171<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
172 href="../chapter08/kernel.xml"
173 xpointer="xpointer(/sect1/sect2[@role='content'])"/>
174
175</sect1>
176
Note: See TracBrowser for help on using the repository browser.