kernel-inst.xml 3.6 KB

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