kernel-inst.xml 3.3 KB

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