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