[ac89fab] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[c2133bc] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[ac89fab] | 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
| 6 | <sect1 id="ch-bootable-kernel" role="wrap" arch="raq2">
|
---|
| 7 | <title>Linux-&linux-raq2-version;</title>
|
---|
| 8 | <?dbhtml filename="kernel.html"?>
|
---|
| 9 |
|
---|
| 10 | <indexterm zone="ch-bootable-kernel"><primary sortas="a-Linux">Linux</primary></indexterm>
|
---|
| 11 |
|
---|
[0fb69dd] | 12 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 13 | href="../chapter08/kernel.xml"
|
---|
| 14 | xpointer="xpointer(/sect1/sect2[@role='package'])"/>
|
---|
[ac89fab] | 15 |
|
---|
| 16 | <sect2 role="installation">
|
---|
| 17 | <title>Installation of the kernel</title>
|
---|
| 18 |
|
---|
| 19 | <para>Building the kernel involves a few steps—configuration,
|
---|
| 20 | compilation, and installation. Read the <filename>README</filename>
|
---|
| 21 | file in the kernel source tree for alternate methods to the way this
|
---|
| 22 | book configures the kernel.</para>
|
---|
| 23 |
|
---|
| 24 | <para>The following patch fixes some issues with MIPS based processors
|
---|
| 25 | and the kernel:</para>
|
---|
| 26 |
|
---|
| 27 | <screen><userinput>patch -Np1 -i ../linux-&linux-raq2-version;-mips-1.patch</userinput></screen>
|
---|
| 28 |
|
---|
| 29 | <para>Prepare for compilation by running the following command:</para>
|
---|
| 30 |
|
---|
| 31 | <screen><userinput>make mrproper</userinput></screen>
|
---|
| 32 |
|
---|
| 33 | <para>This ensures that the kernel tree is absolutely clean. The
|
---|
| 34 | kernel team recommends that this command be issued prior to each
|
---|
| 35 | kernel compilation. Do not rely on the source tree being clean after
|
---|
| 36 | un-tarring.</para>
|
---|
| 37 |
|
---|
| 38 | <para>Also, ensure that the kernel does not attempt to pass
|
---|
| 39 | hotplugging events to userspace until userspace specifies that it is
|
---|
| 40 | ready:</para>
|
---|
| 41 |
|
---|
| 42 | <screen><userinput>sed -i 's@/sbin/hotplug@/bin/true@' kernel/kmod.c</userinput></screen>
|
---|
| 43 |
|
---|
| 44 | <para>If, in <xref linkend="ch-scripts-console" role=","/> it was decided to
|
---|
| 45 | compile the keymap into the kernel, issue the command below:</para>
|
---|
| 46 |
|
---|
| 47 | <screen><userinput>loadkeys -m /usr/share/kbd/keymaps/<replaceable>[path to keymap]</replaceable> > \
|
---|
| 48 | drivers/char/defkeymap.c</userinput></screen>
|
---|
| 49 |
|
---|
| 50 | <para>For example, if using a Dutch keyboard, use
|
---|
[1cc7be0] | 51 | <filename>/usr/share/kbd/keymaps/i386/qwerty/nl.map.gz</filename>.</para>
|
---|
[ac89fab] | 52 |
|
---|
| 53 | <para>Configure the kernel via a menu-driven interface:</para>
|
---|
| 54 |
|
---|
| 55 | <screen><userinput>make menuconfig</userinput></screen>
|
---|
| 56 |
|
---|
| 57 | <para>Alternatively, <command>make cobalt_defconfig</command> may be more appropriate in some
|
---|
| 58 | situations. <phrase>This will build a basic system with no modules and
|
---|
| 59 | ext2 support only.</phrase> See the <filename>README</filename> file for more
|
---|
| 60 | information.</para>
|
---|
| 61 |
|
---|
| 62 | <para>If desired, skip kernel configuration by copying the kernel
|
---|
| 63 | config file, <filename>.config</filename>, from the host system
|
---|
| 64 | (assuming it is available) to the unpacked <filename
|
---|
| 65 | class="directory">linux-&linux-raq2-version;</filename> directory. However,
|
---|
| 66 | we do not recommend this option. It is often better to explore all the
|
---|
| 67 | configuration menus and create the kernel configuration from
|
---|
| 68 | scratch.</para>
|
---|
| 69 |
|
---|
| 70 | <para>For POSIX-shared memory support, ensure that the kernel config
|
---|
| 71 | option <quote>Virtual memory file system support</quote> is enabled.
|
---|
| 72 | It resides within the <quote>File systems</quote> menu and is normally
|
---|
| 73 | enabled by default.</para>
|
---|
| 74 |
|
---|
| 75 | <para>LFS bootscripts make the assumption that either both
|
---|
| 76 | <quote>Support for Host-side USB</quote> and <quote>USB device
|
---|
| 77 | filesystem</quote> have been compiled directly into the kernel, or
|
---|
| 78 | that neither is compiled at all. Bootscripts will not work properly
|
---|
| 79 | if it is a module (usbcore.ko).</para>
|
---|
| 80 |
|
---|
| 81 | <note><para>NPTL requires the kernel to be compiled with GCC 3.x, in
|
---|
| 82 | this case &gcc-version;. Compiling with 2.95.x is known to cause failures in
|
---|
| 83 | the glibc test suite, so it is not recommended to compile the kernel
|
---|
| 84 | with gcc 2.95.x.</para></note>
|
---|
| 85 |
|
---|
| 86 | <para>Compile the kernel image and modules:</para>
|
---|
| 87 |
|
---|
| 88 | <screen><userinput>make</userinput></screen>
|
---|
| 89 |
|
---|
| 90 | <para>If using kernel modules, an
|
---|
| 91 | <filename>/etc/modprobe.conf</filename> file may be needed.
|
---|
| 92 | Information pertaining to modules and kernel configuration is
|
---|
| 93 | located in the kernel documentation in the <filename
|
---|
| 94 | class="directory">linux-&linux-raq2-version;/Documentation</filename>
|
---|
| 95 | directory. The <emphasis>modprobe.conf</emphasis> man page may also be
|
---|
| 96 | of interest.</para>
|
---|
| 97 |
|
---|
| 98 | <para>Be very careful when reading other documentation because it
|
---|
| 99 | usually applies to 2.4.x kernels only. As far as we know, kernel
|
---|
| 100 | configuration issues specific to Hotplug and Udev are not documented.
|
---|
| 101 | The problem is that Udev will create a device node only if Hotplug or
|
---|
| 102 | a user-written script inserts the corresponding module into the
|
---|
| 103 | kernel, and not all modules are detectable by Hotplug. Note that
|
---|
| 104 | statements like the one below in the
|
---|
| 105 | <filename>/etc/modprobe.conf</filename> file do not work with
|
---|
| 106 | Udev:</para>
|
---|
| 107 |
|
---|
| 108 | <para><screen>alias char-major-XXX some-module</screen></para>
|
---|
| 109 |
|
---|
| 110 | <para>Because of the complications with Hotplug, Udev, and modules, we
|
---|
| 111 | strongly recommend starting with a completely non-modular kernel
|
---|
| 112 | configuration, especially if this is the first time using Udev.</para>
|
---|
| 113 |
|
---|
| 114 | <para>Install the modules, if the kernel configuration uses them:</para>
|
---|
| 115 |
|
---|
| 116 | <screen><userinput>make modules_install</userinput></screen>
|
---|
| 117 |
|
---|
| 118 | <para>If there are many modules and very little space, consider
|
---|
| 119 | stripping and compressing the modules. For most users, such
|
---|
| 120 | compression is not worth the time, but if the system is pressed for
|
---|
| 121 | space, see <ulink url="http://www.linux-mips.org/archives/linux-mips/2002-04/msg00031.html"/>.</para>
|
---|
| 122 |
|
---|
| 123 | <para>After kernel compilation is complete, additional steps are
|
---|
| 124 | required to complete the installation. Some files need to be copied to
|
---|
| 125 | the <filename class="directory">/boot</filename> directory.</para>
|
---|
| 126 |
|
---|
| 127 | <para><!--The path to the kernel image may vary depending on the platform
|
---|
| 128 | being used. -->Issue the following command to install the kernel:</para>
|
---|
| 129 |
|
---|
| 130 | <screen><userinput>cp vmlinux /boot/vmlinux-&linux-version;
|
---|
| 131 | gzip -9 /boot/vmlinux-&linux-version;</userinput></screen>
|
---|
| 132 |
|
---|
| 133 | <para><filename>System.map</filename> is a symbol file for the kernel.
|
---|
| 134 | It maps the function entry points of every function in the kernel API,
|
---|
| 135 | as well as the addresses of the kernel data structures for the running
|
---|
| 136 | kernel. Issue the following command to install the map file:</para>
|
---|
| 137 |
|
---|
| 138 | <screen><userinput>cp System.map /boot/System.map-&linux-raq2-version;</userinput></screen>
|
---|
| 139 |
|
---|
| 140 | <para>The kernel configuration file <filename>.config</filename>
|
---|
| 141 | produced by the <command>make menuconfig</command> step
|
---|
| 142 | above contains all the configuration selections for the kernel
|
---|
| 143 | that was just compiled. It is a good idea to keep this file for future
|
---|
| 144 | reference:</para>
|
---|
| 145 |
|
---|
| 146 | <screen><userinput>cp .config /boot/config-&linux-raq2-version;</userinput></screen>
|
---|
| 147 |
|
---|
| 148 | <para>It is important to note that the files in the kernel source
|
---|
| 149 | directory are not owned by <emphasis>root</emphasis>. Whenever a
|
---|
| 150 | package is unpacked as user <emphasis>root</emphasis> (like we did
|
---|
| 151 | inside chroot), the files have the user and group IDs of whatever
|
---|
| 152 | they were on the packager's computer. This is usually not a problem
|
---|
| 153 | for any other package to be installed because the source tree is
|
---|
| 154 | removed after the installation. However, the Linux source tree is
|
---|
| 155 | often retained for a long time. Because of this, there is a chance
|
---|
| 156 | that whatever user ID the packager used will be assigned to somebody
|
---|
| 157 | on the machine. That person would then have write access to the kernel
|
---|
| 158 | source.</para>
|
---|
| 159 |
|
---|
| 160 | <para>If the kernel source tree is going to retained, run
|
---|
| 161 | <command>chown -R 0:0</command> on the <filename
|
---|
| 162 | class="directory">linux-&linux-raq2-version;</filename> directory to ensure
|
---|
| 163 | all files are owned by user <emphasis>root</emphasis>.</para>
|
---|
| 164 | </sect2>
|
---|
| 165 |
|
---|
[0fb69dd] | 166 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 167 | href="../chapter08/kernel.xml"
|
---|
| 168 | xpointer="xpointer(/sect1/sect2[@role='content'])"/>
|
---|
[ac89fab] | 169 |
|
---|
| 170 | </sect1>
|
---|
| 171 |
|
---|