kernel.xml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <sect1 id="ch08-kernel">
  2. <title>Installing Linux-&kernel-version;</title>
  3. <?dbhtml filename="kernel.html" dir="chapter08"?>
  4. <screen>Estimated build time: &kernel-time;
  5. Estimated required disk space: &kernel-compsize;</screen>
  6. <para>Building the kernel involves a few steps: configuring it and compiling
  7. it. There are a few ways to configure the kernel. If you don't like the
  8. way this book does it, read the <filename>README</filename> that comes
  9. with the kernel source tree, and find out what the other options are.</para>
  10. <para>Something you could do, is take the <filename>.config</filename>
  11. file from your host distribution's kernel source tree and copy it to
  12. <filename class="directory">$LFS/usr/src/linux</filename>.
  13. This way you don't have to configure the entire kernel from scratch and
  14. can use your current values. If you choose to do this, first run the
  15. <userinput>make mrproper</userinput> command below, then copy the
  16. <filename>.config</filename> file over, then run
  17. <userinput>make menuconfig</userinput> followed by the rest of the commands
  18. (<userinput>make oldconfig</userinput> may be better in some situations.
  19. See the <filename>README</filename> file for more details when to use
  20. <userinput>make oldconfig</userinput>).</para>
  21. <para>If you intend to use kernel modules, you will need an
  22. <filename>/etc/modules.conf</filename> file. Information pertaining
  23. to modules and to kernel configuration in general may be found in the
  24. kernel documentation, which is stored stored in
  25. <filename>/usr/src/linux/Documentation</filename>. The modules.conf man
  26. page and the kernel HOWTO at
  27. <ulink url="http://www.tldp.org/HOWTO/Kernel-HOWTO.html"/> may also be of
  28. interest to you.</para>
  29. <para>The following commands are run to build the kernel:</para>
  30. <para><screen><userinput>cd /usr/src/linux &amp;&amp;</userinput>
  31. <userinput>make mrproper &amp;&amp;</userinput>
  32. <userinput>make menuconfig &amp;&amp;</userinput>
  33. <userinput>make dep &amp;&amp;</userinput>
  34. <userinput>make bzImage &amp;&amp;</userinput>
  35. <userinput>make modules &amp;&amp;</userinput>
  36. <userinput>make modules_install &amp;&amp;</userinput>
  37. <userinput>cp arch/i386/boot/bzImage /boot/lfskernel &amp;&amp;</userinput>
  38. <userinput>cp System.map /boot</userinput></screen></para>
  39. <para>Note: the arch/i386/boot/bzImage path may vary on
  40. different platforms.</para>
  41. &aa-kernel-dep;
  42. </sect1>