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 | </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 | <para os="e">Configure the kernel via a menu-driven interface.
|
---|
40 | Please note that the udev bootscript requires "rtc" and "tmpfs" to be
|
---|
41 | enabled and built into the kernel, not as modules. BLFS has
|
---|
42 | some information regarding particular kernel configuration requirements of
|
---|
43 | packages outside of CLFS at <ulink
|
---|
44 | url="&blfs-root;view/svn/longindex.html#kernel-config-index"/>:</para>
|
---|
45 |
|
---|
46 | <screen os="f"><userinput>make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}- menuconfig</userinput></screen>
|
---|
47 |
|
---|
48 | <para os="g">Alternatively, <command>make oldconfig</command> may be more
|
---|
49 | appropriate in some situations. See the <filename>README</filename>
|
---|
50 | file for more information.</para>
|
---|
51 |
|
---|
52 | <para os="h">If desired, skip kernel configuration by copying the kernel
|
---|
53 | config file, <filename>.config</filename>, from the host system
|
---|
54 | (assuming it is available) to the root directory of the unpacked kernel
|
---|
55 | sources. However, we do not recommend this option. It is often better
|
---|
56 | to explore all the configuration menus and create the kernel configuration
|
---|
57 | from scratch.</para>
|
---|
58 |
|
---|
59 | <para os="i">Compile the kernel image and modules:</para>
|
---|
60 |
|
---|
61 | <screen os="j"><userinput>make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}-</userinput></screen>
|
---|
62 |
|
---|
63 | <para os="k">If using kernel modules, an
|
---|
64 | <filename>/etc/modprobe.conf</filename> file may be needed.
|
---|
65 | Information pertaining to modules and kernel configuration is
|
---|
66 | located in the kernel documentation in the <filename
|
---|
67 | class="directory">Documentation</filename> directory of the kernel
|
---|
68 | sources tree. Also, <filename>modprobe.conf(5)</filename> may
|
---|
69 | be of interest.</para>
|
---|
70 |
|
---|
71 | <para os="l">Be very careful when reading other documentation relating to
|
---|
72 | kernel modules because it usually applies to 2.4.x kernels only. As
|
---|
73 | far as we know, kernel configuration issues specific to Hotplug and
|
---|
74 | Udev are not documented. The problem is that Udev will create a device
|
---|
75 | node only if Hotplug or a user-written script inserts the corresponding
|
---|
76 | module into the kernel, and not all modules are detectable by Hotplug.
|
---|
77 | Note that statements like the one below in the
|
---|
78 | <filename>/etc/modprobe.conf</filename> file do not work with Udev:</para>
|
---|
79 |
|
---|
80 | <screen os="m"><literal>alias char-major-XXX some-module</literal></screen>
|
---|
81 |
|
---|
82 | <para os="n">Because of the complications with Udev and modules,
|
---|
83 | we strongly recommend starting with a completely non-modular kernel
|
---|
84 | configuration, especially if this is the first time using Udev.</para>
|
---|
85 |
|
---|
86 | <para os="o">Install the modules, if the kernel configuration uses
|
---|
87 | them:</para>
|
---|
88 |
|
---|
89 | <screen os="p"><userinput>make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}- \
|
---|
90 | INSTALL_MOD_PATH=${CLFS} modules_install</userinput></screen>
|
---|
91 |
|
---|
92 | <para os="q">After kernel compilation is complete, additional steps are
|
---|
93 | required to complete the installation. Some files need to be copied to
|
---|
94 | the <filename class="directory">${CLFS}/boot</filename> directory.</para>
|
---|
95 |
|
---|
96 | <para os="r">Issue the following command to install the kernel:</para>
|
---|
97 |
|
---|
98 | <screen os="s"><userinput>cp vmlinux ${CLFS}/boot/clfskernel-&linux-version;</userinput></screen>
|
---|
99 |
|
---|
100 | <para os="t"><filename>System.map</filename> is a symbol file for the kernel.
|
---|
101 | It maps the function entry points of every function in the kernel API,
|
---|
102 | as well as the addresses of the kernel data structures for the running
|
---|
103 | kernel. Issue the following command to install the map file:</para>
|
---|
104 |
|
---|
105 | <screen os="u"><userinput>cp System.map ${CLFS}/boot/System.map-&linux-version;</userinput></screen>
|
---|
106 |
|
---|
107 | <para os="v">If we compiled our kernel with modules and we made sure depmod.pl
|
---|
108 | is avaiable from busybox, we need to create the module dependency list by
|
---|
109 | issuing the following command:</para>
|
---|
110 |
|
---|
111 | <screen os="w"><userinput>${CLFS}/cross-tools/bin/depmod.pl -F ${CLFS}/boot/System.map -b ${CLFS}/lib/modules/&linux-version;</userinput></screen>
|
---|
112 |
|
---|
113 | <para os="x">The kernel configuration file <filename>.config</filename>
|
---|
114 | produced by the <command>make menuconfig</command> step above contains
|
---|
115 | all the configuration selections for the kernel that was just compiled.
|
---|
116 | It is a good idea to keep this file for future reference:</para>
|
---|
117 |
|
---|
118 | <screen os="y"><userinput>cp .config ${CLFS}/boot/config-&linux-version;</userinput></screen>
|
---|
119 |
|
---|
120 | <warning os="z">
|
---|
121 | <para>Some kernel documentation recommends creating a symlink from
|
---|
122 | <filename class="symlink">/usr/src/linux</filename> pointing to the
|
---|
123 | kernel source directory. This is specific to kernels prior to the
|
---|
124 | 2.6 series and <emphasis>must not</emphasis> be created on an CLFS
|
---|
125 | system as it can cause problems for packages you may wish to build
|
---|
126 | once your base CLFS system is complete.</para>
|
---|
127 |
|
---|
128 | <para>Also, the headers in the system's <filename
|
---|
129 | class="directory">include</filename> directory should
|
---|
130 | <emphasis>always</emphasis> be the ones against which Glibc was
|
---|
131 | compiled (from the Linux-Headers package) and should
|
---|
132 | <emphasis>never</emphasis> be replaced by the kernel headers.</para>
|
---|
133 | </warning>
|
---|
134 |
|
---|
135 | </sect2>
|
---|
136 |
|
---|
137 | <sect2 id="contents-kernel" role="content">
|
---|
138 | <title>Contents of Linux</title>
|
---|
139 |
|
---|
140 | <segmentedlist>
|
---|
141 | <segtitle>Installed files</segtitle>
|
---|
142 |
|
---|
143 | <seglistitem>
|
---|
144 | <seg>config-[linux-version], clfskernel-[linux-version],
|
---|
145 | and System.map-[linux-version]</seg>
|
---|
146 | </seglistitem>
|
---|
147 | </segmentedlist>
|
---|
148 |
|
---|
149 | <variablelist>
|
---|
150 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
151 | <?dbfo list-presentation="list"?>
|
---|
152 | <?dbhtml list-presentation="table"?>
|
---|
153 |
|
---|
154 | <varlistentry id="config">
|
---|
155 | <term><filename>config-[linux-version]</filename></term>
|
---|
156 | <listitem>
|
---|
157 | <para>Contains all the configuration selections for the kernel</para>
|
---|
158 | <indexterm zone="ch-bootable-kernel config">
|
---|
159 | <primary sortas="e-/boot/config">/boot/config-[linux-version]</primary>
|
---|
160 | </indexterm>
|
---|
161 | </listitem>
|
---|
162 | </varlistentry>
|
---|
163 |
|
---|
164 | <varlistentry id="clfskernel">
|
---|
165 | <term><filename>clfskernel-[linux-version]</filename></term>
|
---|
166 | <listitem>
|
---|
167 | <para>The engine of the Linux system. When turning on the
|
---|
168 | computer, the kernel is the first part of the operating system
|
---|
169 | that gets loaded. It detects and initializes all components of
|
---|
170 | the computer's hardware, then makes these components available
|
---|
171 | as a tree of files to the software and turns a single CPU into
|
---|
172 | a multitasking machine capable of running scores of programs
|
---|
173 | seemingly at the same time.</para>
|
---|
174 | <indexterm zone="ch-bootable-kernel clfskernel">
|
---|
175 | <primary sortas="b-clfskernel">clfskernel-[linux-version]</primary>
|
---|
176 | </indexterm>
|
---|
177 | </listitem>
|
---|
178 | </varlistentry>
|
---|
179 |
|
---|
180 | <varlistentry id="System.map">
|
---|
181 | <term><filename>System.map-[linux-version]</filename></term>
|
---|
182 | <listitem>
|
---|
183 | <para>A list of addresses and symbols; it maps the entry points
|
---|
184 | and addresses of all the functions and data structures in the
|
---|
185 | kernel</para>
|
---|
186 | <indexterm zone="ch-bootable-kernel System.map">
|
---|
187 | <primary sortas="e-/boot/System.map">/boot/System.map-[linux-version]</primary>
|
---|
188 | </indexterm>
|
---|
189 | </listitem>
|
---|
190 | </varlistentry>
|
---|
191 |
|
---|
192 | </variablelist>
|
---|
193 |
|
---|
194 | </sect2>
|
---|
195 |
|
---|
196 | </sect1>
|
---|