source: BOOK/bootable/x86/kernel.xml@ 4dca606

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 4dca606 was aa18ac0, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Updated trunk book sources to use DocBook-XML DTD 4.5.

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