[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
|
---|
[684183e] | 29 | kernel config file, <filename>.config</filename>, from your host system
|
---|
| 30 | (assuming it is available) to the unpacked
|
---|
| 31 | <filename class="directory">linux-&kernel-version;</filename> directory.
|
---|
| 32 | However, we don't recommend this option. You're much better off exploring all
|
---|
| 33 | the configuration menus and creating your own kernel configuration from
|
---|
| 34 | scratch.</para>
|
---|
[cce4232] | 35 |
|
---|
[1e66abe] | 36 | <para>For POSIX shared memory support, ensure that the kernel config option
|
---|
| 37 | "Virtual memory file system support" is enabled. It resides within the "File
|
---|
| 38 | systems" menu and is normally enabled by default.</para>
|
---|
[fbcfacd] | 39 |
|
---|
[cce4232] | 40 | <para>Verify dependencies and create dependency information files:</para>
|
---|
| 41 |
|
---|
[bc82645e] | 42 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc dep</userinput></screen></para>
|
---|
[cce4232] | 43 |
|
---|
| 44 | <para>Compile the kernel image:</para>
|
---|
| 45 |
|
---|
[bc82645e] | 46 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc bzImage</userinput></screen></para>
|
---|
[cce4232] | 47 |
|
---|
| 48 | <para>Compile the drivers which have been configured as modules:</para>
|
---|
| 49 |
|
---|
[bc82645e] | 50 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules</userinput></screen></para>
|
---|
[3c09bf8] | 51 |
|
---|
| 52 | <para>If you intend to use kernel modules, you will need an
|
---|
| 53 | <filename>/etc/modules.conf</filename> file. Information pertaining
|
---|
| 54 | to modules and to kernel configuration in general may be found in the
|
---|
[684183e] | 55 | kernel documentation, which is found in the
|
---|
| 56 | <filename>linux-&kernel-version;/Documentation</filename> directory. The
|
---|
[3c09bf8] | 57 | modules.conf man page and the kernel HOWTO at
|
---|
| 58 | <ulink url="&tldp-root;HOWTO/Kernel-HOWTO.html"/> may also be of
|
---|
| 59 | interest to you.</para>
|
---|
| 60 |
|
---|
[cce4232] | 61 | <para>Install the modules:</para>
|
---|
[3c09bf8] | 62 |
|
---|
[bc82645e] | 63 | <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules_install</userinput></screen></para>
|
---|
[3c09bf8] | 64 |
|
---|
[a8b6190] | 65 | <para>As nothing is complete without documentation, build the manual pages
|
---|
| 66 | that come with the kernel:</para>
|
---|
| 67 |
|
---|
| 68 | <para><screen><userinput>make mandocs</userinput></screen></para>
|
---|
| 69 |
|
---|
| 70 | <para>And install these pages:</para>
|
---|
| 71 |
|
---|
| 72 | <para><screen><userinput>cp -a Documentation/man /usr/share/man/man9</userinput></screen></para>
|
---|
| 73 |
|
---|
[cce4232] | 74 | <para>Kernel compilation has finished, but some of the files created
|
---|
| 75 | still reside in the source tree. To complete the installation, two
|
---|
| 76 | files should to be copied to the <filename>/boot</filename>
|
---|
| 77 | directory.</para>
|
---|
| 78 |
|
---|
| 79 | <para>The path to the kernel file may vary depending on the platform
|
---|
| 80 | you're using. Issue the following command to install the kernel:</para>
|
---|
[3c09bf8] | 81 |
|
---|
[cce4232] | 82 | <para><screen><userinput>cp arch/i386/boot/bzImage /boot/lfskernel</userinput></screen></para>
|
---|
[3c09bf8] | 83 |
|
---|
[cce4232] | 84 | <para><filename>System.map</filename> is a symbol file for the kernel.
|
---|
| 85 | It maps the function entrypoints of every function in the kernel API,
|
---|
| 86 | as well as the addresses of the kernel data structures for the running
|
---|
| 87 | kernel. Issue the following command to install the map file:</para>
|
---|
[3c09bf8] | 88 |
|
---|
[cce4232] | 89 | <para><screen><userinput>cp System.map /boot</userinput></screen></para>
|
---|
[3c09bf8] | 90 |
|
---|
| 91 | </sect2>
|
---|