lilo.xml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <sect1 id="ch08-lilo">
  2. <title>Making the LFS system bootable</title>
  3. <para>
  4. In order to being able to boot the LFS system, we need to update our
  5. bootloader. We're assuming that your host system is using Lilo (since
  6. that's the most commonly used boot loader at the moment).
  7. </para>
  8. <para>
  9. We will not be running the lilo program inside chroot. Running lilo
  10. inside chroot can have fatal side-effects which render your MBR useless
  11. and you'd need a boot disk to be able to start any Linux system (either
  12. the host system or the LFS system).
  13. </para>
  14. <para>
  15. First we'll exit chroot and copy the lfskernel file to the host system:
  16. </para>
  17. <blockquote><literallayout>
  18. <userinput>logout</userinput>
  19. <userinput>cp $LFS/boot/lfskernel /boot</userinput>
  20. </literallayout></blockquote>
  21. <para>
  22. The next step is adding an entry to /etc/lilo.conf so that we can
  23. choose LFS when booting the computer:
  24. </para>
  25. <literallayout>
  26. <userinput>cat &gt;&gt; /etc/lilo.conf &lt;&lt; "EOF"</userinput>
  27. image=/boot/lfskernel
  28. label=lfs
  29. root=&lt;partition&gt;
  30. read-only
  31. <userinput>EOF</userinput>
  32. </literallayout>
  33. <para>
  34. &lt;partition&gt; must be replaced by the LFS partition's designation.
  35. </para>
  36. <para>
  37. Now the boot loader gets updated by running:
  38. </para>
  39. <blockquote><literallayout>
  40. <userinput>/sbin/lilo</userinput>
  41. </literallayout></blockquote>
  42. <para>
  43. The last step is syncing the host system lilo config. files with the
  44. LFS system:
  45. </para>
  46. <blockquote><literallayout>
  47. <userinput>cp /etc/lilo.conf $LFS/etc &amp;&amp;</userinput>
  48. <userinput>cp &lt;kernel images&gt; $LFS/boot</userinput>
  49. </literallayout></blockquote>
  50. <para>
  51. To find out which kernel images files are being used, look at the
  52. /etc/lilo.conf file and find the lines starting with
  53. <emphasis>image=</emphasis>. If your host system has kernel files in
  54. other places than the /boot directory, make sure you update the paths
  55. in the $LFS/etc/lilo.conf file so that it does look for them in the
  56. /boot directory.
  57. </para>
  58. <para>
  59. As soon as we have booted into LFS we can run
  60. <userinput>/sbin/lilo</userinput> from the LFS system in order to have
  61. the latest Lilo version in the MBR.
  62. </para>
  63. </sect1>