[3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[aa18ac0] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[3f8be484] | 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 |
|
---|
[43daa01] | 11 | <title>Linux-&linux-version;</title>
|
---|
[3f8be484] | 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 |
|
---|
[77e81f1] | 39 | <para os="h">Configure the kernel via a menu-driven interface.
|
---|
| 40 | Please note that the udev bootscript requires "rtc" and "tmpfs" to be
|
---|
[0d4607d] | 41 | enabled and built into the kernel, not as modules. CBLFS has
|
---|
[3f8be484] | 42 | some information regarding particular kernel configuration requirements of
|
---|
[fb40919] | 43 | packages outside of CLFS at <ulink
|
---|
[0d4607d] | 44 | url="&cblfs-root;"/>:</para>
|
---|
[3f8be484] | 45 |
|
---|
| 46 | <screen os="i"><userinput>make menuconfig</userinput></screen>
|
---|
| 47 |
|
---|
| 48 | <para os="j">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="k">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="m">Compile the kernel image and modules:</para>
|
---|
| 60 |
|
---|
| 61 | <screen os="n"><userinput>make</userinput></screen>
|
---|
| 62 |
|
---|
| 63 | <para os="o">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="p">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="q"><literal>alias char-major-XXX some-module</literal></screen>
|
---|
| 81 |
|
---|
[5d9d2e5] | 82 | <para os="r">Because of the complications with Udev and modules,
|
---|
[3f8be484] | 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="s">Install the modules, if the kernel configuration uses
|
---|
| 87 | them:</para>
|
---|
| 88 |
|
---|
| 89 | <screen os="t"><userinput>make modules_install</userinput></screen>
|
---|
| 90 |
|
---|
| 91 | <para os="u">After kernel compilation is complete, additional steps are
|
---|
| 92 | required to complete the installation. Some files need to be copied to
|
---|
| 93 | the <filename class="directory">/boot</filename> directory.</para>
|
---|
| 94 |
|
---|
| 95 | <para os="v">Issue the following command to install the kernel:</para>
|
---|
| 96 |
|
---|
[e51ba26] | 97 | <screen><userinput>cp -v arch/i386/boot/bzImage /boot/clfskernel-&linux-version;</userinput></screen>
|
---|
[3f8be484] | 98 |
|
---|
| 99 | <para os="w"><filename>System.map</filename> is a symbol file for the kernel.
|
---|
| 100 | It maps the function entry points of every function in the kernel API,
|
---|
| 101 | as well as the addresses of the kernel data structures for the running
|
---|
| 102 | kernel. Issue the following command to install the map file:</para>
|
---|
| 103 |
|
---|
[e51ba26] | 104 | <screen os="w1"><userinput>cp -v System.map /boot/System.map-&linux-version;</userinput></screen>
|
---|
[3f8be484] | 105 |
|
---|
| 106 | <para os="x">The kernel configuration file <filename>.config</filename>
|
---|
| 107 | produced by the <command>make menuconfig</command> step above contains
|
---|
| 108 | all the configuration selections for the kernel that was just compiled.
|
---|
| 109 | It is a good idea to keep this file for future reference:</para>
|
---|
| 110 |
|
---|
[e51ba26] | 111 | <screen os="x1"><userinput>cp -v .config /boot/config-&linux-version;</userinput></screen>
|
---|
[3f8be484] | 112 |
|
---|
| 113 | <para os="y">It is important to note that the files in the kernel source
|
---|
| 114 | directory are not owned by <systemitem class="username">root</systemitem>.
|
---|
| 115 | Whenever a package is unpacked as user <systemitem
|
---|
[a7fa075] | 116 | class="username">root</systemitem> (like we do inside the final-system
|
---|
| 117 | build environment), the files have the user and group IDs of whatever
|
---|
[3f8be484] | 118 | they were on the packager's computer. This is usually not a problem
|
---|
| 119 | for any other package to be installed because the source tree is
|
---|
| 120 | removed after the installation. However, the Linux source tree is
|
---|
[a7fa075] | 121 | often retained for a long time. Because of this, there is a chance
|
---|
[3f8be484] | 122 | that whatever user ID the packager used will be assigned to somebody
|
---|
| 123 | on the machine. That person would then have write access to the kernel
|
---|
| 124 | source.</para>
|
---|
| 125 |
|
---|
[43daa01] | 126 | <para os="y1">If the kernel source tree is going to retained, run
|
---|
[3f8be484] | 127 | <command>chown -R 0:0</command> on the <filename
|
---|
[43daa01] | 128 | class="directory">linux-&linux-version;</filename> directory to
|
---|
[3f8be484] | 129 | ensure all files are owned by user <systemitem
|
---|
| 130 | class="username">root</systemitem>.</para>
|
---|
| 131 |
|
---|
| 132 | <warning os="z">
|
---|
| 133 | <para>Some kernel documentation recommends creating a symlink from
|
---|
| 134 | <filename class="symlink">/usr/src/linux</filename> pointing to the
|
---|
| 135 | kernel source directory. This is specific to kernels prior to the
|
---|
[fb40919] | 136 | 2.6 series and <emphasis>must not</emphasis> be created on a CLFS
|
---|
[3f8be484] | 137 | system as it can cause problems for packages you may wish to build
|
---|
[fb40919] | 138 | once your base CLFS system is complete.</para>
|
---|
[3f8be484] | 139 |
|
---|
| 140 | <para>Also, the headers in the system's <filename
|
---|
| 141 | class="directory">include</filename> directory should
|
---|
| 142 | <emphasis>always</emphasis> be the ones against which Glibc was
|
---|
[5d9d2e5] | 143 | compiled (from the Linux-Headers package) and should
|
---|
| 144 | <emphasis>never</emphasis> be replaced by the kernel headers.</para>
|
---|
[3f8be484] | 145 | </warning>
|
---|
| 146 |
|
---|
| 147 | </sect2>
|
---|
| 148 |
|
---|
| 149 | <sect2 id="contents-kernel" role="content">
|
---|
| 150 | <title>Contents of Linux</title>
|
---|
| 151 |
|
---|
| 152 | <segmentedlist>
|
---|
| 153 | <segtitle>Installed files</segtitle>
|
---|
| 154 |
|
---|
| 155 | <seglistitem>
|
---|
[3f76cac] | 156 | <seg>config-[linux-version], clfskernel-[linux-version],
|
---|
[3f8be484] | 157 | and System.map-[linux-version]</seg>
|
---|
| 158 | </seglistitem>
|
---|
| 159 | </segmentedlist>
|
---|
| 160 |
|
---|
| 161 | <variablelist>
|
---|
| 162 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 163 | <?dbfo list-presentation="list"?>
|
---|
| 164 | <?dbhtml list-presentation="table"?>
|
---|
| 165 |
|
---|
| 166 | <varlistentry id="config">
|
---|
| 167 | <term><filename>config-[linux-version]</filename></term>
|
---|
| 168 | <listitem>
|
---|
| 169 | <para>Contains all the configuration selections for the kernel</para>
|
---|
| 170 | <indexterm zone="ch-bootable-kernel config">
|
---|
| 171 | <primary sortas="e-/boot/config">/boot/config-[linux-version]</primary>
|
---|
| 172 | </indexterm>
|
---|
| 173 | </listitem>
|
---|
| 174 | </varlistentry>
|
---|
| 175 |
|
---|
[3f76cac] | 176 | <varlistentry id="clfskernel">
|
---|
| 177 | <term><filename>clfskernel-[linux-version]</filename></term>
|
---|
[3f8be484] | 178 | <listitem>
|
---|
| 179 | <para>The engine of the Linux system. When turning on the
|
---|
| 180 | computer, the kernel is the first part of the operating system
|
---|
| 181 | that gets loaded. It detects and initializes all components of
|
---|
| 182 | the computer's hardware, then makes these components available
|
---|
| 183 | as a tree of files to the software and turns a single CPU into
|
---|
| 184 | a multitasking machine capable of running scores of programs
|
---|
| 185 | seemingly at the same time.</para>
|
---|
[3f76cac] | 186 | <indexterm zone="ch-bootable-kernel clfskernel">
|
---|
| 187 | <primary sortas="b-clfskernel">clfskernel-[linux-version]</primary>
|
---|
[3f8be484] | 188 | </indexterm>
|
---|
| 189 | </listitem>
|
---|
| 190 | </varlistentry>
|
---|
| 191 |
|
---|
| 192 | <varlistentry id="System.map">
|
---|
| 193 | <term><filename>System.map-[linux-version]</filename></term>
|
---|
| 194 | <listitem>
|
---|
| 195 | <para>A list of addresses and symbols; it maps the entry points
|
---|
| 196 | and addresses of all the functions and data structures in the
|
---|
| 197 | kernel</para>
|
---|
| 198 | <indexterm zone="ch-bootable-kernel System.map">
|
---|
| 199 | <primary sortas="e-/boot/System.map">/boot/System.map-[linux-version]</primary>
|
---|
| 200 | </indexterm>
|
---|
| 201 | </listitem>
|
---|
| 202 | </varlistentry>
|
---|
| 203 |
|
---|
| 204 | </variablelist>
|
---|
| 205 |
|
---|
| 206 | </sect2>
|
---|
| 207 |
|
---|
| 208 | </sect1>
|
---|