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—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="b">Prepare for compilation by running the following command:</para>
|
---|
31 |
|
---|
32 | <screen os="c"><userinput>make mrproper</userinput></screen>
|
---|
33 |
|
---|
34 | <para os="d">This ensures that the kernel tree is absolutely clean. The
|
---|
35 | kernel team recommends that this command be issued prior to each
|
---|
36 | kernel compilation. Do not rely on the source tree being clean after
|
---|
37 | un-tarring.</para>
|
---|
38 |
|
---|
39 | <note os="kc"><para>A good starting place for setting up the kernel
|
---|
40 | configuration is to run <command>make defconfig</command>. This will set the base configuration to a good state that takes your current system
|
---|
41 | architecture into account.</para>
|
---|
42 |
|
---|
43 | <para>Be sure to enable or disable following features or the system might
|
---|
44 | not work correctly or boot at all.<!-- Refer to
|
---|
45 | <filename>/usr/share/doc/systemd-&systemd-version;/README</filename> -->:</para>
|
---|
46 |
|
---|
47 | <screen role="nodump">Device Drivers --->
|
---|
48 | Generic Driver Options --->
|
---|
49 | () path to uevent helper
|
---|
50 | [*] Maintain a devtmpfs filesystem to mount at /dev
|
---|
51 | [ ] Fallback user-helper invocation for firmware loading</screen></note>
|
---|
52 |
|
---|
53 | <note os="kd"><para>While "The IPv6 Protocol" is not strictly required, it
|
---|
54 | is highly recommended by the Systemd developers. "EFI Variable support" and
|
---|
55 | "EFI GUID Partition support" are for UEFI systems. "Collect scheduler
|
---|
56 | debugging info" and "Collect scheduler statistics" is for systemd-bootchart.
|
---|
57 | </para></note>
|
---|
58 |
|
---|
59 | <para os="h">Configure the kernel via a menu-driven interface.
|
---|
60 | CBLFS has some information regarding particular kernel configuration
|
---|
61 | requirements of packages outside of CLFS at <ulink
|
---|
62 | url="&cblfs-root;"/>:</para>
|
---|
63 |
|
---|
64 | <screen os="i"><userinput>make menuconfig</userinput></screen>
|
---|
65 |
|
---|
66 | <para os="j">Alternatively, <command>make oldconfig</command> may be more
|
---|
67 | appropriate in some situations. See the <filename>README</filename>
|
---|
68 | file for more information.</para>
|
---|
69 |
|
---|
70 | <para os="k">If desired, skip kernel configuration by copying the kernel
|
---|
71 | config file, <filename>.config</filename>, from the host system
|
---|
72 | (assuming it is available) to the root directory of the unpacked kernel
|
---|
73 | sources. However, we do not recommend this option. It is often better
|
---|
74 | to explore all the configuration menus and create the kernel configuration
|
---|
75 | from scratch.</para>
|
---|
76 |
|
---|
77 | <para os="m">Compile the kernel image and modules:</para>
|
---|
78 |
|
---|
79 | <screen os="n"><userinput>make</userinput></screen>
|
---|
80 |
|
---|
81 | <para os="o">If using kernel modules, an
|
---|
82 | <filename>/etc/modprobe.conf</filename> file may be needed.
|
---|
83 | Information pertaining to modules and kernel configuration is
|
---|
84 | located in the kernel documentation in the <filename
|
---|
85 | class="directory">Documentation</filename> directory of the kernel
|
---|
86 | sources tree. Also, <filename>modprobe.conf(5)</filename> may
|
---|
87 | be of interest.</para>
|
---|
88 |
|
---|
89 | <para os="p">Be very careful when reading other documentation relating to
|
---|
90 | kernel modules because it usually applies to 2.4.x kernels only. As
|
---|
91 | far as we know, kernel configuration issues specific to Hotplug and
|
---|
92 | Eudev are not documented. The problem is that Eudev will create a device
|
---|
93 | node only if Hotplug or a user-written script inserts the corresponding
|
---|
94 | module into the kernel, and not all modules are detectable by Hotplug.
|
---|
95 | Note that statements like the one below in the
|
---|
96 | <filename>/etc/modprobe.conf</filename> file do not work with Eudev:</para>
|
---|
97 |
|
---|
98 | <screen os="q"><literal>alias char-major-XXX some-module</literal></screen>
|
---|
99 |
|
---|
100 | <para os="r">Because of the complications with Eudev and modules,
|
---|
101 | we strongly recommend starting with a completely non-modular kernel
|
---|
102 | configuration, especially if this is the first time using Eudev.</para>
|
---|
103 |
|
---|
104 | <para os="s">Install the modules, if the kernel configuration uses
|
---|
105 | them:</para>
|
---|
106 |
|
---|
107 | <screen os="t"><userinput>make modules_install</userinput></screen>
|
---|
108 |
|
---|
109 | <para os="s2">Install the firmware, if the kernel configuration uses
|
---|
110 | them:</para>
|
---|
111 |
|
---|
112 | <screen os="t2"><userinput>make firmware_install</userinput></screen>
|
---|
113 |
|
---|
114 | <para os="u">After kernel compilation is complete, additional steps are
|
---|
115 | required to complete the installation. Some files need to be copied to
|
---|
116 | the <filename class="directory">/boot</filename> directory.</para>
|
---|
117 |
|
---|
118 | <para os="v">Issue the following command to install the kernel:</para>
|
---|
119 |
|
---|
120 | <screen><userinput>cp -v arch/i386/boot/bzImage /boot/vmlinuz-clfs-&linux-version;</userinput></screen>
|
---|
121 |
|
---|
122 | <para os="w"><filename>System.map</filename> is a symbol file for the kernel.
|
---|
123 | It maps the function entry points of every function in the kernel API,
|
---|
124 | as well as the addresses of the kernel data structures for the running
|
---|
125 | kernel. Issue the following command to install the map file:</para>
|
---|
126 |
|
---|
127 | <screen os="w1"><userinput>cp -v System.map /boot/System.map-&linux-version;</userinput></screen>
|
---|
128 |
|
---|
129 | <para os="x">The kernel configuration file <filename>.config</filename>
|
---|
130 | produced by the <command>make menuconfig</command> step above contains
|
---|
131 | all the configuration selections for the kernel that was just compiled.
|
---|
132 | It is a good idea to keep this file for future reference:</para>
|
---|
133 |
|
---|
134 | <screen os="x1"><userinput>cp -v .config /boot/config-&linux-version;</userinput></screen>
|
---|
135 |
|
---|
136 | <para os="y">It is important to note that the files in the kernel source
|
---|
137 | directory are not owned by <systemitem class="username">root</systemitem>.
|
---|
138 | Whenever a package is unpacked as user <systemitem
|
---|
139 | class="username">root</systemitem> (like we do inside the final-system
|
---|
140 | build environment), the files have the user and group IDs of whatever
|
---|
141 | they were on the packager's computer. This is usually not a problem
|
---|
142 | for any other package to be installed because the source tree is
|
---|
143 | removed after the installation. However, the Linux source tree is
|
---|
144 | often retained for a long time. Because of this, there is a chance
|
---|
145 | that whatever user ID the packager used will be assigned to somebody
|
---|
146 | on the machine. That person would then have write access to the kernel
|
---|
147 | source.</para>
|
---|
148 |
|
---|
149 | <para os="y1">If the kernel source tree is going to retained, run
|
---|
150 | <command>chown -R 0:0</command> on the <filename
|
---|
151 | class="directory">linux-&linux-version;</filename> directory to
|
---|
152 | ensure all files are owned by user <systemitem
|
---|
153 | class="username">root</systemitem>.</para>
|
---|
154 |
|
---|
155 | <warning os="z">
|
---|
156 | <para>Some kernel documentation recommends creating a symlink from
|
---|
157 | <filename class="symlink">/usr/src/linux</filename> pointing to the
|
---|
158 | kernel source directory. This is specific to kernels prior to the
|
---|
159 | 2.6 series and <emphasis>must not</emphasis> be created on a CLFS
|
---|
160 | system as it can cause problems for packages you may wish to build
|
---|
161 | once your base CLFS system is complete.</para>
|
---|
162 |
|
---|
163 | <para>Also, the headers in the system's <filename
|
---|
164 | class="directory">include</filename> directory should
|
---|
165 | <emphasis>always</emphasis> be the ones against which Glibc was
|
---|
166 | compiled and should <emphasis>never</emphasis> be replaced by headers
|
---|
167 | from a different kernel version.</para>
|
---|
168 | </warning>
|
---|
169 |
|
---|
170 | </sect2>
|
---|
171 |
|
---|
172 | <sect2 id="contents-kernel" role="content">
|
---|
173 | <title>Contents of Linux</title>
|
---|
174 |
|
---|
175 | <segmentedlist>
|
---|
176 | <segtitle>Installed files</segtitle>
|
---|
177 | <segtitle>Installed directory</segtitle>
|
---|
178 |
|
---|
179 | <seglistitem>
|
---|
180 | <seg>config-[linux-version], clfskernel-[linux-version],
|
---|
181 | and System.map-[linux-version]</seg>
|
---|
182 | <seg>/lib/modules</seg>
|
---|
183 | </seglistitem>
|
---|
184 | </segmentedlist>
|
---|
185 |
|
---|
186 | <variablelist>
|
---|
187 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
188 | <?dbfo list-presentation="list"?>
|
---|
189 | <?dbhtml list-presentation="table"?>
|
---|
190 |
|
---|
191 | <varlistentry id="config">
|
---|
192 | <term><filename>config-[linux-version]</filename></term>
|
---|
193 | <listitem>
|
---|
194 | <para>Contains all the configuration selections for the kernel</para>
|
---|
195 | <indexterm zone="ch-bootable-kernel config">
|
---|
196 | <primary sortas="e-/boot/config">/boot/config-[linux-version]</primary>
|
---|
197 | </indexterm>
|
---|
198 | </listitem>
|
---|
199 | </varlistentry>
|
---|
200 |
|
---|
201 | <varlistentry id="clfskernel">
|
---|
202 | <term><filename>clfskernel-[linux-version]</filename></term>
|
---|
203 | <listitem>
|
---|
204 | <para>The engine of the Linux system. When turning on the
|
---|
205 | computer, the kernel is the first part of the operating system
|
---|
206 | that gets loaded. It detects and initializes all components of
|
---|
207 | the computer's hardware, then makes these components available
|
---|
208 | as a tree of files to the software and turns a single CPU into
|
---|
209 | a multitasking machine capable of running scores of programs
|
---|
210 | seemingly at the same time.</para>
|
---|
211 | <indexterm zone="ch-bootable-kernel clfskernel">
|
---|
212 | <primary sortas="b-clfskernel">clfskernel-[linux-version]</primary>
|
---|
213 | </indexterm>
|
---|
214 | </listitem>
|
---|
215 | </varlistentry>
|
---|
216 |
|
---|
217 | <varlistentry id="System.map">
|
---|
218 | <term><filename>System.map-[linux-version]</filename></term>
|
---|
219 | <listitem>
|
---|
220 | <para>A list of addresses and symbols; it maps the entry points
|
---|
221 | and addresses of all the functions and data structures in the
|
---|
222 | kernel</para>
|
---|
223 | <indexterm zone="ch-bootable-kernel System.map">
|
---|
224 | <primary sortas="e-/boot/System.map">/boot/System.map-[linux-version]</primary>
|
---|
225 | </indexterm>
|
---|
226 | </listitem>
|
---|
227 | </varlistentry>
|
---|
228 |
|
---|
229 | </variablelist>
|
---|
230 |
|
---|
231 | </sect2>
|
---|
232 |
|
---|
233 | </sect1>
|
---|