source: bootable/x86/kernel.xml@ 695df81

Last change on this file since 695df81 was 930f404, checked in by Jim Gifford <clfs@…>, 19 years ago

r724@server (orig r722): manuel | 2005-11-19 09:59:45 -0800
Unifiying linux and linux-libc-headers package version entities. Bootable chapter.

  • Property mode set to 100644
File size: 10.1 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-bootable-kernel" role="wrap">
9 <?dbhtml filename="kernel.html"?>
10
11 <title>Linux-&linux-version;</title>
12
13 <indexterm zone="ch-bootable-kernel">
14 <primary sortas="a-Linux">Linux</primary>
15 </indexterm>
16
17 <sect2 role="package"><title/>
18 <para>The Linux package contains the Linux kernel.</para>
19
20 <segmentedlist>
21 <segtitle>&dependencies;</segtitle>
22
23 <seglistitem>
24 <seg>Bash, Binutils, Coreutils, Findutils, GCC, Glibc, Grep,
25 Gzip, Make, Modutils, Perl, and Sed</seg>
26 </seglistitem>
27 </segmentedlist>
28
29 </sect2>
30
31 <sect2 role="installation">
32 <title>Installation of the kernel</title>
33
34 <para os="a">Building the kernel involves a few steps&mdash;configuration,
35 compilation, and installation. Read the <filename>README</filename>
36 file in the kernel source tree for alternative methods to the way this
37 book configures the kernel.</para>
38
39 <para os="b">Prepare for compilation by running the following command:</para>
40
41<screen os="c"><userinput>make mrproper</userinput></screen>
42
43 <para os="d">This ensures that the kernel tree is absolutely clean. The
44 kernel team recommends that this command be issued prior to each
45 kernel compilation. Do not rely on the source tree being clean after
46 un-tarring.</para>
47
48 <para os="e">If, in <xref linkend="ch-scripts-console" role=","/> it was
49 decided to compile the keymap into the kernel, issue the command
50 below:</para>
51
52<screen os="f"><userinput>loadkeys -m /usr/share/kbd/keymaps/<replaceable>[path to keymap]</replaceable> &gt; \
53 drivers/char/defkeymap.c</userinput></screen>
54
55 <para os="g">For example, if using a Dutch keyboard, use
56 <filename>/usr/share/kbd/keymaps/i386/qwerty/nl.map.gz</filename>.</para>
57
58 <para os="h">Configure the kernel via a menu-driven interface. BLFS has
59 some information regarding particular kernel configuration requirements of
60 packages outside of LFS at <ulink
61 url="&blfs-root;view/svn/longindex.html#kernel-config-index"/>:</para>
62
63<screen os="i"><userinput>make menuconfig</userinput></screen>
64
65 <para os="j">Alternatively, <command>make oldconfig</command> may be more
66 appropriate in some situations. See the <filename>README</filename>
67 file for more information.</para>
68
69 <para os="k">If desired, skip kernel configuration by copying the kernel
70 config file, <filename>.config</filename>, from the host system
71 (assuming it is available) to the root directory of the unpacked kernel
72 sources. However, we do not recommend this option. It is often better
73 to explore all the configuration menus and create the kernel configuration
74 from scratch.</para>
75
76 <note os="l">
77 <para>Linux-2.6 kernel series requires to be compiled with GCC-3.x or
78 later, in this case &gcc-version;. It is not recommended to compile the
79 kernel with GCC-2.95.x, as this causes failures in the Glibc test suite.
80 Normally, this wouldn't be mentioned as LFS doesn't build GCC-2.95.x.
81 Unfortunately, the kernel documentation is outdated and still claims
82 GCC-2.95.3 is the recommended compiler.</para>
83 </note>
84
85 <para os="m">Compile the kernel image and modules:</para>
86
87<screen os="n"><userinput>make</userinput></screen>
88
89 <para os="o">If using kernel modules, an
90 <filename>/etc/modprobe.conf</filename> file may be needed.
91 Information pertaining to modules and kernel configuration is
92 located in the kernel documentation in the <filename
93 class="directory">Documentation</filename> directory of the kernel
94 sources tree. Also, <filename>modprobe.conf(5)</filename> may
95 be of interest.</para>
96
97 <para os="p">Be very careful when reading other documentation relating to
98 kernel modules because it usually applies to 2.4.x kernels only. As
99 far as we know, kernel configuration issues specific to Hotplug and
100 Udev are not documented. The problem is that Udev will create a device
101 node only if Hotplug or a user-written script inserts the corresponding
102 module into the kernel, and not all modules are detectable by Hotplug.
103 Note that statements like the one below in the
104 <filename>/etc/modprobe.conf</filename> file do not work with Udev:</para>
105
106<screen os="q"><literal>alias char-major-XXX some-module</literal></screen>
107
108 <para os="r">Because of the complications with Hotplug, Udev, and modules,
109 we strongly recommend starting with a completely non-modular kernel
110 configuration, especially if this is the first time using Udev.</para>
111
112 <para os="s">Install the modules, if the kernel configuration uses
113 them:</para>
114
115<screen os="t"><userinput>make modules_install</userinput></screen>
116
117 <para os="u">After kernel compilation is complete, additional steps are
118 required to complete the installation. Some files need to be copied to
119 the <filename class="directory">/boot</filename> directory.</para>
120
121 <para os="v">Issue the following command to install the kernel:</para>
122
123<screen><userinput>cp arch/i386/boot/bzImage /boot/lfskernel-&linux-version;</userinput></screen>
124
125 <para os="w"><filename>System.map</filename> is a symbol file for the kernel.
126 It maps the function entry points of every function in the kernel API,
127 as well as the addresses of the kernel data structures for the running
128 kernel. Issue the following command to install the map file:</para>
129
130<screen os="w1"><userinput>cp System.map /boot/System.map-&linux-version;</userinput></screen>
131
132 <para os="x">The kernel configuration file <filename>.config</filename>
133 produced by the <command>make menuconfig</command> step above contains
134 all the configuration selections for the kernel that was just compiled.
135 It is a good idea to keep this file for future reference:</para>
136
137<screen os="x1"><userinput>cp .config /boot/config-&linux-version;</userinput></screen>
138
139 <para os="y">It is important to note that the files in the kernel source
140 directory are not owned by <systemitem class="username">root</systemitem>.
141 Whenever a package is unpacked as user <systemitem
142 class="username">root</systemitem> (like we did
143 inside chroot), the files have the user and group IDs of whatever
144 they were on the packager's computer. This is usually not a problem
145 for any other package to be installed because the source tree is
146 removed after the installation. However, the Linux source tree is
147 often retained for a long time. Because of this, there is a chance
148 that whatever user ID the packager used will be assigned to somebody
149 on the machine. That person would then have write access to the kernel
150 source.</para>
151
152 <para os="y1">If the kernel source tree is going to retained, run
153 <command>chown -R 0:0</command> on the <filename
154 class="directory">linux-&linux-version;</filename> directory to
155 ensure all files are owned by user <systemitem
156 class="username">root</systemitem>.</para>
157
158 <warning os="z">
159 <para>Some kernel documentation recommends creating a symlink from
160 <filename class="symlink">/usr/src/linux</filename> pointing to the
161 kernel source directory. This is specific to kernels prior to the
162 2.6 series and <emphasis>must not</emphasis> be created on an LFS
163 system as it can cause problems for packages you may wish to build
164 once your base LFS system is complete.</para>
165
166 <para>Also, the headers in the system's <filename
167 class="directory">include</filename> directory should
168 <emphasis>always</emphasis> be the ones against which Glibc was
169 compiled, that is, the ones from the Linux-Libc-Headers package,
170 and therefore, should <emphasis>never</emphasis> be replaced by
171 the kernel headers.</para>
172 </warning>
173
174 </sect2>
175
176 <sect2 id="contents-kernel" role="content">
177 <title>Contents of Linux</title>
178
179 <segmentedlist>
180 <segtitle>Installed files</segtitle>
181
182 <seglistitem>
183 <seg>config-[linux-version], lfskernel-[linux-version],
184 and System.map-[linux-version]</seg>
185 </seglistitem>
186 </segmentedlist>
187
188 <variablelist>
189 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
190 <?dbfo list-presentation="list"?>
191 <?dbhtml list-presentation="table"?>
192
193 <varlistentry id="config">
194 <term><filename>config-[linux-version]</filename></term>
195 <listitem>
196 <para>Contains all the configuration selections for the kernel</para>
197 <indexterm zone="ch-bootable-kernel config">
198 <primary sortas="e-/boot/config">/boot/config-[linux-version]</primary>
199 </indexterm>
200 </listitem>
201 </varlistentry>
202
203 <varlistentry id="lfskernel">
204 <term><filename>lfskernel-[linux-version]</filename></term>
205 <listitem>
206 <para>The engine of the Linux system. When turning on the
207 computer, the kernel is the first part of the operating system
208 that gets loaded. It detects and initializes all components of
209 the computer's hardware, then makes these components available
210 as a tree of files to the software and turns a single CPU into
211 a multitasking machine capable of running scores of programs
212 seemingly at the same time.</para>
213 <indexterm zone="ch-bootable-kernel lfskernel">
214 <primary sortas="b-lfskernel">lfskernel-[linux-version]</primary>
215 </indexterm>
216 </listitem>
217 </varlistentry>
218
219 <varlistentry id="System.map">
220 <term><filename>System.map-[linux-version]</filename></term>
221 <listitem>
222 <para>A list of addresses and symbols; it maps the entry points
223 and addresses of all the functions and data structures in the
224 kernel</para>
225 <indexterm zone="ch-bootable-kernel System.map">
226 <primary sortas="e-/boot/System.map">/boot/System.map-[linux-version]</primary>
227 </indexterm>
228 </listitem>
229 </varlistentry>
230
231 </variablelist>
232
233 </sect2>
234
235</sect1>
Note: See TracBrowser for help on using the repository browser.