1 | <sect2><title> </title><para> </para></sect2>
|
---|
2 |
|
---|
3 | <sect2>
|
---|
4 | <title>Installation of the kernel</title>
|
---|
5 |
|
---|
6 | <para>Building the kernel involves a few steps: configuration,
|
---|
7 | compilation, and installation. If you don't like the way this
|
---|
8 | book configures the kernel, view the <filename>README</filename>
|
---|
9 | file in the kernel source tree for alternative methods.</para>
|
---|
10 |
|
---|
11 | <para>Prepare for compilation by running the following command:</para>
|
---|
12 |
|
---|
13 | <para><screen><userinput>make mrproper</userinput></screen></para>
|
---|
14 |
|
---|
15 | <para>This ensures that the kernel tree is absolutely clean. The kernel
|
---|
16 | team recommends that this command be issued prior to
|
---|
17 | <emphasis>each</emphasis> kernel compilation. You shouldn't rely
|
---|
18 | on the source tree being clean after untarring.</para>
|
---|
19 |
|
---|
20 | <para>Configure the kernel via a menu-driven interface:</para>
|
---|
21 |
|
---|
22 | <para><screen><userinput>make menuconfig</userinput></screen></para>
|
---|
23 |
|
---|
24 | <para><userinput>make oldconfig</userinput> may be more appropriate
|
---|
25 | in some situations. See the <filename>README</filename> file for
|
---|
26 | more information.</para>
|
---|
27 |
|
---|
28 | <para>If you wish, you may skip kernel configuration by copying the
|
---|
29 | kernel config file, <filename>.config</filename>, from your host
|
---|
30 | system to the
|
---|
31 | <filename class="directory">$LFS/usr/src/linux-&kernel-version;</filename>
|
---|
32 | directory.</para>
|
---|
33 |
|
---|
34 | <para>Verify dependencies and create dependency information files:</para>
|
---|
35 |
|
---|
36 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc dep</userinput></screen></para>
|
---|
37 |
|
---|
38 | <para>Compile the kernel image:</para>
|
---|
39 |
|
---|
40 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc bzImage</userinput></screen></para>
|
---|
41 |
|
---|
42 | <para>Compile the drivers which have been configured as modules:</para>
|
---|
43 |
|
---|
44 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules</userinput></screen></para>
|
---|
45 |
|
---|
46 | <para>If you intend to use kernel modules, you will need an
|
---|
47 | <filename>/etc/modules.conf</filename> file. Information pertaining
|
---|
48 | to modules and to kernel configuration in general may be found in the
|
---|
49 | kernel documentation, which is stored stored in
|
---|
50 | <filename>/usr/src/linux-&kernel-version;/Documentation</filename>. The
|
---|
51 | modules.conf man page and the kernel HOWTO at
|
---|
52 | <ulink url="&tldp-root;HOWTO/Kernel-HOWTO.html"/> may also be of
|
---|
53 | interest to you.</para>
|
---|
54 |
|
---|
55 | <para>Install the modules:</para>
|
---|
56 |
|
---|
57 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules_install</userinput></screen></para>
|
---|
58 |
|
---|
59 | <para>Kernel compilation has finished, but some of the files created
|
---|
60 | still reside in the source tree. To complete the installation, two
|
---|
61 | files should to be copied to the <filename>/boot</filename>
|
---|
62 | directory.</para>
|
---|
63 |
|
---|
64 | <para>The path to the kernel file may vary depending on the platform
|
---|
65 | you're using. Issue the following command to install the kernel:</para>
|
---|
66 |
|
---|
67 | <para><screen><userinput>cp arch/i386/boot/bzImage /boot/lfskernel</userinput></screen></para>
|
---|
68 |
|
---|
69 | <para><filename>System.map</filename> is a symbol file for the kernel.
|
---|
70 | It maps the function entrypoints of every function in the kernel API,
|
---|
71 | as well as the addresses of the kernel data structures for the running
|
---|
72 | kernel. Issue the following command to install the map file:</para>
|
---|
73 |
|
---|
74 | <para><screen><userinput>cp System.map /boot</userinput></screen></para>
|
---|
75 |
|
---|
76 | </sect2>
|
---|