kernel-inst.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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: configuring it and compiling
  5. it. There are a few ways to configure the kernel. If you don't like the
  6. way this book does it, read the <filename>README</filename> that comes
  7. with the kernel source tree, and find out what the other options are.</para>
  8. <para>Something you could do, is take the <filename>.config</filename>
  9. file from your host distribution's kernel source tree and copy it to
  10. <filename class="directory">$LFS/usr/src/linux-&kernel-version;</filename>.
  11. This way you don't have to configure the entire kernel from scratch and
  12. can use your current values. If you choose to do this, first run the
  13. <userinput>make mrproper</userinput> command below, then copy the
  14. <filename>.config</filename> file over, then run
  15. <userinput>make menuconfig</userinput> followed by the rest of the commands
  16. (<userinput>make oldconfig</userinput> may be better in some situations.
  17. See the <filename>README</filename> file for more details when to use
  18. <userinput>make oldconfig</userinput>).</para>
  19. <para>If you intend to use kernel modules, you will need an
  20. <filename>/etc/modules.conf</filename> file. Information pertaining
  21. to modules and to kernel configuration in general may be found in the
  22. kernel documentation, which is stored stored in
  23. <filename>/usr/src/linux-&kernel-version;/Documentation</filename>. The
  24. modules.conf man page and the kernel HOWTO at
  25. <ulink url="&tldp-root;HOWTO/Kernel-HOWTO.html"/> may also be of
  26. interest to you.</para>
  27. <para>Prepare for compilation by running the following command:</para>
  28. <para><screen><userinput>make mrproper</userinput></screen></para>
  29. <para>This ensures that the kernel tree is absolutely clean. The kernel
  30. team recommends that this command be issued prior to
  31. <emphasis>each</emphasis> kernel compilation. You shouldn't rely
  32. on the source tree being clean after untarring.</para>
  33. <para><screen><userinput>make menuconfig &amp;&amp;
  34. make dep &amp;&amp;
  35. make bzImage &amp;&amp;
  36. make modules &amp;&amp;
  37. make modules_install</userinput></screen></para>
  38. <para>Kernel compilation has finished, but the files created are still
  39. in the source tree. The path to the kernel file,
  40. <filename>arch/i386/boot/bzImage</filename> below, may vary depending
  41. on the platform you're using.</para>
  42. <para><screen><userinput>cp arch/i386/boot/bzImage /boot/lfskernel &amp;&amp;
  43. cp System.map /boot</userinput></screen></para>
  44. </sect2>