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