kernel-inst.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. <para><screen><userinput>make mrproper</userinput></screen></para>
  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. <para><screen><userinput>make menuconfig</userinput></screen></para>
  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 copying the
  20. kernel config file, <filename>.config</filename>, from your host
  21. system to the
  22. <filename class="directory">$LFS/usr/src/linux-&kernel-version;</filename>
  23. directory.</para>
  24. <para>Verify dependencies and create dependency information files:</para>
  25. <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc dep</userinput></screen></para>
  26. <para>Compile the kernel image:</para>
  27. <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc bzImage</userinput></screen></para>
  28. <para>Compile the drivers which have been configured as modules:</para>
  29. <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules</userinput></screen></para>
  30. <para>If you intend to use kernel modules, you will need an
  31. <filename>/etc/modules.conf</filename> file. Information pertaining
  32. to modules and to kernel configuration in general may be found in the
  33. kernel documentation, which is stored stored in
  34. <filename>/usr/src/linux-&kernel-version;/Documentation</filename>. The
  35. modules.conf man page and the kernel HOWTO at
  36. <ulink url="&tldp-root;HOWTO/Kernel-HOWTO.html"/> may also be of
  37. interest to you.</para>
  38. <para>Install the modules:</para>
  39. <para><screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules_install</userinput></screen></para>
  40. <para>Kernel compilation has finished, but some of the files created
  41. still reside in the source tree. To complete the installation, two
  42. files should to be copied to the <filename>/boot</filename>
  43. directory.</para>
  44. <para>The path to the kernel file may vary depending on the platform
  45. you're using. Issue the following command to install the kernel:</para>
  46. <para><screen><userinput>cp arch/i386/boot/bzImage /boot/lfskernel</userinput></screen></para>
  47. <para><filename>System.map</filename> is a symbol file for the kernel.
  48. It maps the function entrypoints of every function in the kernel API,
  49. as well as the addresses of the kernel data structures for the running
  50. kernel. Issue the following command to install the map file:</para>
  51. <para><screen><userinput>cp System.map /boot</userinput></screen></para>
  52. </sect2>