source: bootable/x86/kernel.xml @ 2659c74

Last change on this file since 2659c74 was 2659c74, checked in by Jim Gifford <clfs@…>, 17 years ago

r677@server (orig r675): manuel | 2005-11-10 03:13:57 -0800
Including patches.ent from general.ent

  • Property mode set to 100644
File size: 10.1 KB
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3  "" [
4  <!ENTITY % general-entities SYSTEM "../../general.ent">
5  %general-entities;
8<sect1 id="ch-bootable-kernel" role="wrap">
9  <?dbhtml filename="kernel.html"?>
11  <title>Linux-&linux-x86-version;</title>
13  <indexterm zone="ch-bootable-kernel">
14    <primary sortas="a-Linux">Linux</primary>
15  </indexterm>
17  <sect2 role="package"><title/>
18    <para>The Linux package contains the Linux kernel.</para>
20    <segmentedlist>
21      <segtitle>&dependencies;</segtitle>
23      <seglistitem>
24        <seg>Bash, Binutils, Coreutils, Findutils, GCC, Glibc, Grep,
25        Gzip, Make, Modutils, Perl, and Sed</seg>
26      </seglistitem>
27    </segmentedlist>
29  </sect2>
31  <sect2 role="installation">
32    <title>Installation of the kernel</title>
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>
39    <para os="b">Prepare for compilation by running the following command:</para>
41<screen os="c"><userinput>make mrproper</userinput></screen>
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>
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>
52<screen os="f"><userinput>loadkeys -m /usr/share/kbd/keymaps/<replaceable>[path to  keymap]</replaceable> &gt; \
53    drivers/char/defkeymap.c</userinput></screen>
55    <para os="g">For example, if using a Dutch keyboard, use
56    <filename>/usr/share/kbd/keymaps/i386/qwerty/</filename>.</para>
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>
63<screen os="i"><userinput>make menuconfig</userinput></screen>
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>
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>
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>
85    <para os="m">Compile the kernel image and modules:</para>
87<screen os="n"><userinput>make</userinput></screen>
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>
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>
106<screen os="q"><literal>alias char-major-XXX some-module</literal></screen>
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>
112    <para os="s">Install the modules, if the kernel configuration uses
113    them:</para>
115<screen os="t"><userinput>make modules_install</userinput></screen>
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>
121    <para os="v">Issue the following command to install the kernel:</para>
123<screen><userinput>cp arch/i386/boot/bzImage /boot/lfskernel-&linux-x86-version;</userinput></screen>
125    <para os="w"><filename></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>
130<screen><userinput>cp /boot/;</userinput></screen>
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>
137<screen><userinput>cp .config /boot/config-&linux-x86-version;</userinput></screen>
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>
152    <para>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-x86-version;</filename> directory to
155    ensure all files are owned by user <systemitem
156    class="username">root</systemitem>.</para>
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>
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>
174  </sect2>
176  <sect2 id="contents-kernel" role="content">
177    <title>Contents of Linux</title>
179    <segmentedlist>
180      <segtitle>Installed files</segtitle>
182      <seglistitem>
183        <seg>config-[linux-version], lfskernel-[linux-version],
184        and[linux-version]</seg>
185      </seglistitem>
186    </segmentedlist>
188    <variablelist>
189      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
190      <?dbfo list-presentation="list"?>
191      <?dbhtml list-presentation="table"?>
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>
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>
219      <varlistentry id="">
220        <term><filename>[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">
226            <primary sortas="e-/boot/">/boot/[linux-version]</primary>
227          </indexterm>
228        </listitem>
229      </varlistentry>
231    </variablelist>
233  </sect2>
Note: See TracBrowser for help on using the repository browser.