kernel-inst.xml 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  2. <sect2>
  3. <title>Installation of the kernel</title>
  4. <para>Building the kernel involves a few steps: configuration,
  5. compilation, and installation. If you don't like the way this
  6. book configures the kernel, view the <filename>README</filename>
  7. file in the kernel source tree for alternative methods.</para>
  8. <para>Prepare for compilation by running the following command:</para>
  9. <screen><userinput>make mrproper</userinput></screen>
  10. <para>This ensures that the kernel tree is absolutely clean. The kernel
  11. team recommends that this command be issued prior to
  12. <emphasis>each</emphasis> kernel compilation. You shouldn't rely
  13. on the source tree being clean after untarring.</para>
  14. <para>Configure the kernel via a menu-driven interface:</para>
  15. <screen><userinput>make menuconfig</userinput></screen>
  16. <para><userinput>make oldconfig</userinput> may be more appropriate
  17. in some situations. See the <filename>README</filename> file for
  18. more information.</para>
  19. <para>If you wish, you may skip kernel configuration by simply copying the
  20. kernel config file, <filename>.config</filename>, from your host system
  21. (assuming it is available) to the unpacked
  22. <filename class="directory">linux-&kernel-version;</filename> directory.
  23. However, we don't recommend this option. You're much better off exploring all
  24. the configuration menus and creating your own kernel configuration from
  25. scratch.</para>
  26. <para>For POSIX shared memory support, ensure that the kernel config option
  27. "Virtual memory file system support" is enabled. It resides within the
  28. "File systems" menu and is normally enabled by default.</para>
  29. <para>Verify dependencies and create dependency information files:</para>
  30. <screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc dep</userinput></screen>
  31. <para>Compile the kernel image:</para>
  32. <screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc bzImage</userinput></screen>
  33. <para>Compile the drivers which have been configured as modules:</para>
  34. <screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules</userinput></screen>
  35. <para>If you intend to use kernel modules, you will need an
  36. <filename>/etc/modules.conf</filename> file. Information pertaining
  37. to modules and to kernel configuration in general may be found in the
  38. kernel documentation, which is found in the
  39. <filename>linux-&kernel-version;/Documentation</filename> directory. The
  40. modules.conf man page and the kernel HOWTO at
  41. <ulink url="&tldp-root;HOWTO/Kernel-HOWTO.html"/> may also be of
  42. interest to you.</para>
  43. <para>Install the modules:</para>
  44. <screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules_install</userinput></screen>
  45. <para>As nothing is complete without documentation, build the manual pages
  46. that come with the kernel:</para>
  47. <screen><userinput>make mandocs</userinput></screen>
  48. <para>And install these pages:</para>
  49. <screen><userinput>cp -a Documentation/man /usr/share/man/man9</userinput></screen>
  50. <para>Kernel compilation has finished but more steps are required to complete
  51. the installation. Some files need to be copied to the <filename>/boot</filename>
  52. directory.</para>
  53. <para>The path to the kernel image may vary depending on the platform
  54. you're using. Issue the following command to install the kernel:</para>
  55. <screen><userinput>cp arch/i386/boot/bzImage /boot/lfskernel</userinput></screen>
  56. <para><filename>System.map</filename> is a symbol file for the kernel.
  57. It maps the function entrypoints of every function in the kernel API,
  58. as well as the addresses of the kernel data structures for the running
  59. kernel. Issue the following command to install the map file:</para>
  60. <screen><userinput>cp System.map /boot</userinput></screen>
  61. <para><filename>.config</filename> is the kernel configuration file that was
  62. produced by the <userinput>make menuconfig</userinput> step above. It contains
  63. all the config selections for the kernel that was just compiled. It's a good
  64. idea to keep this file for future reference:</para>
  65. <screen><userinput>cp .config /boot/config-lfskernel</userinput></screen>
  66. </sect2>