1 | <sect1 id="ch08-lilo">
|
---|
2 | <title>Making the LFS system bootable</title>
|
---|
3 |
|
---|
4 | <para>
|
---|
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 useless
|
---|
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 | <userinput>logout</userinput>
|
---|
23 | <userinput>cp $LFS/boot/lfskernel /boot</userinput>
|
---|
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:
|
---|
29 | </para>
|
---|
30 |
|
---|
31 | <literallayout>
|
---|
32 | <userinput>cat >> /etc/lilo.conf << "EOF"</userinput>
|
---|
33 | image=/boot/lfskernel
|
---|
34 | label=lfs
|
---|
35 | root=<partition>
|
---|
36 | read-only
|
---|
37 | <userinput>EOF</userinput>
|
---|
38 | </literallayout>
|
---|
39 |
|
---|
40 | <para>
|
---|
41 | <partition> must be replaced by the LFS partition's designation.
|
---|
42 | </para>
|
---|
43 |
|
---|
44 | <para>
|
---|
45 | Now the boot loader gets updated by running:
|
---|
46 | </para>
|
---|
47 |
|
---|
48 | <blockquote><literallayout>
|
---|
49 | <userinput>/sbin/lilo</userinput>
|
---|
50 | </literallayout></blockquote>
|
---|
51 |
|
---|
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 |
|
---|
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 |
|
---|
77 | </sect1>
|
---|
78 |
|
---|