lilo.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. <para>
  18. <screen>
  19. <userinput>logout</userinput>
  20. <userinput>cp $LFS/boot/lfskernel /boot</userinput>
  21. </screen>
  22. </para>
  23. <para>
  24. The next step is adding an entry to /etc/lilo.conf so that we can
  25. choose LFS when booting the computer:
  26. </para>
  27. <para>
  28. <screen>
  29. <userinput>cat &gt;&gt; /etc/lilo.conf &lt;&lt; "EOF"</userinput>
  30. image=/boot/lfskernel
  31. label=lfs
  32. root=&lt;partition&gt;
  33. read-only
  34. <userinput>EOF</userinput>
  35. </screen>
  36. </para>
  37. <para>
  38. &lt;partition&gt; must be replaced by the LFS partition's designation.
  39. </para>
  40. <para>
  41. Now the boot loader gets updated by running:
  42. </para>
  43. <para>
  44. <screen>
  45. <userinput>/sbin/lilo</userinput>
  46. </screen>
  47. </para>
  48. <para>
  49. The last step is syncing the host system lilo config. files with the
  50. LFS system:
  51. </para>
  52. <para>
  53. <screen>
  54. <userinput>cp /etc/lilo.conf $LFS/etc &amp;&amp;</userinput>
  55. <userinput>cp &lt;kernel images&gt; $LFS/boot</userinput>
  56. </screen>
  57. </para>
  58. <para>
  59. To find out which kernel images files are being used, look at the
  60. /etc/lilo.conf file and find the lines starting with
  61. <emphasis>image=</emphasis>. If your host system has kernel files in
  62. other places than the /boot directory, make sure you update the paths
  63. in the $LFS/etc/lilo.conf file so that it does look for them in the
  64. /boot directory.
  65. </para>
  66. <para>
  67. As soon as we have booted into LFS we can run
  68. <userinput>/sbin/lilo</userinput> from the LFS system in order to have
  69. the latest Lilo version in the MBR.
  70. </para>
  71. </sect1>