[3c09bf8] | 1 | <sect2><title> </title><para> </para></sect2>
|
---|
| 2 |
|
---|
| 3 | <sect2>
|
---|
| 4 | <title>Installation of the kernel</title>
|
---|
| 5 |
|
---|
[cce4232] | 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 |
|
---|
[5e49531] | 28 | <para>If you wish, you may skip kernel configuration by simply copying the
|
---|
| 29 | kernel config file, <filename>.config</filename>, from your host system to the
|
---|
[cce4232] | 30 | <filename class="directory">$LFS/usr/src/linux-&kernel-version;</filename>
|
---|
| 31 | directory.</para>
|
---|
| 32 |
|
---|
[5e49531] | 33 | <para>It's important to note that to be compliant with POSIX shared memory
|
---|
[fbcfacd] | 34 | requirements, we must enable the tmpfs filesystem option, and mount a tmpfs
|
---|
[5e49531] | 35 | filesystem at <filename>/dev/shm</filename>.</para>
|
---|
[fbcfacd] | 36 |
|
---|
[cce4232] | 37 | <para>Verify dependencies and create dependency information files:</para>
|
---|
| 38 |
|
---|
[bc82645e] | 39 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc dep</userinput></screen></para>
|
---|
[cce4232] | 40 |
|
---|
| 41 | <para>Compile the kernel image:</para>
|
---|
| 42 |
|
---|
[bc82645e] | 43 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc bzImage</userinput></screen></para>
|
---|
[cce4232] | 44 |
|
---|
| 45 | <para>Compile the drivers which have been configured as modules:</para>
|
---|
| 46 |
|
---|
[bc82645e] | 47 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules</userinput></screen></para>
|
---|
[3c09bf8] | 48 |
|
---|
| 49 | <para>If you intend to use kernel modules, you will need an
|
---|
| 50 | <filename>/etc/modules.conf</filename> file. Information pertaining
|
---|
| 51 | to modules and to kernel configuration in general may be found in the
|
---|
| 52 | kernel documentation, which is stored stored in
|
---|
| 53 | <filename>/usr/src/linux-&kernel-version;/Documentation</filename>. The
|
---|
| 54 | modules.conf man page and the kernel HOWTO at
|
---|
| 55 | <ulink url="&tldp-root;HOWTO/Kernel-HOWTO.html"/> may also be of
|
---|
| 56 | interest to you.</para>
|
---|
| 57 |
|
---|
[cce4232] | 58 | <para>Install the modules:</para>
|
---|
[3c09bf8] | 59 |
|
---|
[bc82645e] | 60 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules_install</userinput></screen></para>
|
---|
[3c09bf8] | 61 |
|
---|
[a8b6190] | 62 | <para>As nothing is complete without documentation, build the manual pages
|
---|
| 63 | that come with the kernel:</para>
|
---|
| 64 |
|
---|
| 65 | <para><screen><userinput>make mandocs</userinput></screen></para>
|
---|
| 66 |
|
---|
| 67 | <para>And install these pages:</para>
|
---|
| 68 |
|
---|
| 69 | <para><screen><userinput>cp -a Documentation/man /usr/share/man/man9</userinput></screen></para>
|
---|
| 70 |
|
---|
[cce4232] | 71 | <para>Kernel compilation has finished, but some of the files created
|
---|
| 72 | still reside in the source tree. To complete the installation, two
|
---|
| 73 | files should to be copied to the <filename>/boot</filename>
|
---|
| 74 | directory.</para>
|
---|
| 75 |
|
---|
| 76 | <para>The path to the kernel file may vary depending on the platform
|
---|
| 77 | you're using. Issue the following command to install the kernel:</para>
|
---|
[3c09bf8] | 78 |
|
---|
[cce4232] | 79 | <para><screen><userinput>cp arch/i386/boot/bzImage /boot/lfskernel</userinput></screen></para>
|
---|
[3c09bf8] | 80 |
|
---|
[cce4232] | 81 | <para><filename>System.map</filename> is a symbol file for the kernel.
|
---|
| 82 | It maps the function entrypoints of every function in the kernel API,
|
---|
| 83 | as well as the addresses of the kernel data structures for the running
|
---|
| 84 | kernel. Issue the following command to install the map file:</para>
|
---|
[3c09bf8] | 85 |
|
---|
[cce4232] | 86 | <para><screen><userinput>cp System.map /boot</userinput></screen></para>
|
---|
[3c09bf8] | 87 |
|
---|
| 88 | </sect2>
|
---|