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