1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 | ]>
|
---|
7 |
|
---|
8 | <sect1 id="ch-bootable-lilo">
|
---|
9 | <?dbhtml filename="lilo.html"?>
|
---|
10 |
|
---|
11 | <title>Making the CLFS System Bootable</title>
|
---|
12 |
|
---|
13 | <indexterm zone="ch-bootable-lilo">
|
---|
14 | <primary sortas="a-Lilo">Lilo</primary>
|
---|
15 | <secondary>configuring</secondary>
|
---|
16 | </indexterm>
|
---|
17 |
|
---|
18 | <para os="a">Your shiny new CLFS system is almost complete. One of the
|
---|
19 | last things to do is to ensure that the system can be properly
|
---|
20 | booted. The instructions below apply only to computers using lilo,
|
---|
21 | which in the context of this book means x86_64 Pure64 systems.
|
---|
22 | Information on <quote>boot loading</quote> for other architectures
|
---|
23 | should be available in the usual resource-specific locations for
|
---|
24 | those architectures.</para>
|
---|
25 |
|
---|
26 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
27 | href="../x86/grub.xml"
|
---|
28 | xpointer="xpointer(//*[@os='b'])"/>
|
---|
29 |
|
---|
30 | <para os="c">If you have multiple systems on your machine using a
|
---|
31 | different bootloader such as Grub, you may prefer to use that
|
---|
32 | instead - consult the appropriate documentation. The rest of
|
---|
33 | this section assumes you are going to use Lilo.</para>
|
---|
34 |
|
---|
35 | <para os="d">Earlier, we compiled and installed the Lilo boot loader
|
---|
36 | software in preparation for this step. The procedure involves
|
---|
37 | writing a boot image to a specific location on the hard drive.
|
---|
38 | We highly recommend using mkrescue to create a Lilo boot CD
|
---|
39 | (using e.g. dvdrecord from dvdrtools) as a backup (this requires
|
---|
40 | loopback block device support in the kernel).</para>
|
---|
41 |
|
---|
42 | <para os="e">Normally, you interact with lilo by using the cursor
|
---|
43 | and <literal>enter</literal> keys to select from the available
|
---|
44 | option(s), but sometimes it is necessary to add other boot
|
---|
45 | options, such as e.g. 'init=/bin/bash' to debug boot failures.
|
---|
46 | The more your keyboard layout differs from the US qwerty layout,
|
---|
47 | the harder it becomes to type boot options unless lilo knows
|
---|
48 | about your keyboard layout. So, we will create a key table for
|
---|
49 | Lilo (.ktl) file - at one point in the documentation these are
|
---|
50 | referred to as .klt files, which may be a typo, but has been
|
---|
51 | followed by some distros. The name, and location, are not
|
---|
52 | important but it is conventional to put these in /boot with
|
---|
53 | the name representing the key layout. For a British keyboard
|
---|
54 | layout, the following command will achieve this:</para>
|
---|
55 |
|
---|
56 | <screen os="f" role="nodump"><userinput>keytab-lilo.pl uk >/boot/uk.ktl</userinput></screen>
|
---|
57 |
|
---|
58 | <para os="g">The argument to the command is the name of the keymap,
|
---|
59 | or if necessary you can specify the full path to the keymap. Use
|
---|
60 | whatever is appropriate for your keyboard.</para>
|
---|
61 |
|
---|
62 | <para os="h">When the x86 LFS book used to include Lilo, it
|
---|
63 | advised against running it from chroot in case the MBR became
|
---|
64 | corrupted. Provided you have /proc mounted and have device special
|
---|
65 | files for the disks, it seems to be safe to run recent versions of
|
---|
66 | Lilo in chroot, although it is always possible that an updated
|
---|
67 | bootloader, or defective configuration file, may render the system
|
---|
68 | unbootable.</para>
|
---|
69 |
|
---|
70 | <para os="i">The next step is to create /etc/lilo.conf</para>
|
---|
71 |
|
---|
72 | <screen os="j" role="nodump"><userinput>cat > /etc/lilo.conf << "EOF"
|
---|
73 | <literal># Begin /etc/lilo.conf
|
---|
74 | # lilo.conf
|
---|
75 | #
|
---|
76 | # global options
|
---|
77 | boot=/dev/<bootdisk>
|
---|
78 | keytable=/boot/<keytable>
|
---|
79 | lba32
|
---|
80 | map=/boot/map
|
---|
81 | prompt
|
---|
82 |
|
---|
83 | # set the name of the default image to boot
|
---|
84 | default=lfs
|
---|
85 |
|
---|
86 | # define an image
|
---|
87 | image=/boot/lfskernel
|
---|
88 | label=lfs
|
---|
89 | root=/dev/<partition>
|
---|
90 | read-only
|
---|
91 | # optionally add parameters to pass, e.g.
|
---|
92 | # append="video=radeonfb:1024x768-16@70"
|
---|
93 |
|
---|
94 | # repeat for any other kernel images
|
---|
95 |
|
---|
96 | # optionally, add legacy operating systems
|
---|
97 | # see man lilo.conf for examples
|
---|
98 | EOF</literal></userinput></screen>
|
---|
99 |
|
---|
100 |
|
---|
101 | <para os="k">Replace <bootdisk> with the name of the disk (or
|
---|
102 | partition) on which the boot sector is to be written, e.g. sda.
|
---|
103 | Replace <keytable> with the name of the keytable file you
|
---|
104 | created, and <partition> with the name of the root partition
|
---|
105 | for the new system.
|
---|
106 | </para>
|
---|
107 |
|
---|
108 | <warning os="l">
|
---|
109 | <para>The following command will overwrite the current boot loader.
|
---|
110 | Do not run the command if this is not desired.</para>
|
---|
111 | </warning>
|
---|
112 |
|
---|
113 | <para os="m">Run Lilo:</para>
|
---|
114 |
|
---|
115 | <screen os="n" role="nodump"><userinput>/sbin/lilo -v</userinput></screen>
|
---|
116 |
|
---|
117 | <note os='o'>
|
---|
118 | <para>People who have been used to GRUB need to be aware that
|
---|
119 | lilo works differently - in particular, you cannot edit the
|
---|
120 | available choices as you can in the grub shell, and lilo records
|
---|
121 | the block addresses of the kernels into the boot blocks each time
|
---|
122 | /sbin/lilo is run. This means that when you compile a new kernel,
|
---|
123 | you have to add it to /etc/lilo.conf and rerun /sbin/lilo. It
|
---|
124 | also means that if you recompile an existing kernel and save it
|
---|
125 | to the same name you still have to rerun /sbin/lilo in case it now
|
---|
126 | occupies different blocks on the filesystem.</para>
|
---|
127 | </note>
|
---|
128 |
|
---|
129 | <para os="p">If you are running multiple systems on this box and
|
---|
130 | using lilo, it is a good idea to ensure that each system is running
|
---|
131 | the same version of lilo, otherwise an old version may not be able
|
---|
132 | to overwrite the bootloader from a newer version. You will also
|
---|
133 | need to ensure that the copies of /etc/lilo.conf on each system are
|
---|
134 | kept synchronised.</para>
|
---|
135 |
|
---|
136 | </sect1>
|
---|