Compiling Kernel   «Prev  Next»

Lesson 11 The LILO map installer
Objective Use LILO Map Installer to install Boot Loaders

Use LILO Map Installer to install Boot Loaders in Red Hat

Use the LILO map installer to install first- and second-stage boot loaders.Once you recompile your kernel, you must run the LILO map installer: /sbin/lilo. The LILO map installer installs the first- and second-stage boot loaders. It allows you to
  1. Boot different operating systems
  2. Select the operating system at boot time
  3. Pass parameters to the booting kernel

The installer looks through the new kernel and pulls out symbols, versions, and device information. LILO creates a map file from this information, which LILO will use to correctly boot Linux and other operating systems on your computer. For this to work, the installer needs to know:
  1. Which partitions contain boot sectors or root file systems
  2. How to pass control to bootable partitions

  • The LILO configuration file:
    /etc/lilo.conf contains a list of global options, followed by a block of commands called a stanza. Every stanza holds commands and configuration information for each operating system on your computer. For example, if you have both Windows and Red Hat Linux on your computer, the Linux LILO configuration file would have a Windows-specific stanza and a Red Hat Linux-specific stanza.
    You will need to edit the /etc/lilo.conf file so that the image= value matches the name of the kernel you copied into /boot. For example, if you built a 2.2.14-1 kernel and copied it into /boot with:
              
    cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.2.14-1
    

    Then you will need to have image=/boot/vmlinuz-2.2.14-1 in /etc/lilo.conf.


Global keywords and keyword/value Pairs

Global keywords and value pairs used in /etc/lilo.conf stanzas include
  1. image=/boot/vmlinuz-2.2.14-1.0: The kernel image to boot
  2. label=linux: The label for a kernel image displayed at the LILO prompt
  3. append="aha152x=0x340,11,7,1": Additional parameters to pass to LILO
  4. root=/dev/hda6: The location of the root filesystem
  5. other=/dev/hdb1: The location of an alternate operating system

Blank lines and comments beginning with a pound sign (#) are ignored. All other lines contain keyword/value pairs. For example, the keyword MAIL_DIR is followed by some white space and the value
/var/spool/mail. 

This tells useradd that the initial user e-mail mailbox is created in that directory. Following that are lines that enable you to customize the valid range of automatically assigned user ID numbers or group ID numbers. A comment section that explains that keyword's purpose precedes each keyword. Altering a default value is as simple as editing the value associated with that keyword and then saving the login.defs file. If you want to view the defaults, type the useradd command with the -D option as follows.
# useradd -D
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREAT_MAIL_SPOOL=yes


Keywords in /etc/lilo.conf stanzas

Keywords in the /etc/lilo.conf stanzas include
  1. boot=/dev/hda The location of the first stage loader.
  2. map=/boot/map The map file to install.
  3. install=/boot/boot.b The second stage loader. If this is omitted, the default is /boot/boot.b.
  4. prompt Displays the LILO prompt without requiring the user to press the Shift key. If this is set, but the timeout is not set, the prompt will wait indefinitely.
  5. timeout=50 The time, in tenths of a second, the computer will wait for the user to intervene at the LILO prompt. If this value is not set, the computer will wait indefinitely.
  6. delay=50 The time, in tenths of a second, the computer will wait before booting the default image. If this value is absent or zero, the computer boots the default image immediately.
  7. message=/etc/lilo.msg A file containing a message to be displayed at the LILO prompt.
  8. linear Generates linear sector addresses rather than sector/cylinder/head addresses for hard drives. This is needed only for some hardware, but should not be changed without first consulting your hardware's documentation.
  9. password=redhat A password is required to boot the machine. Because the password is kept unencrypted in /etc/lilo.conf, you should be certain that the file is readable only by root. To do this, type chmod 400 /etc/lilo.conf.
  10. restricted A password is required only if parameters are passed at the LILO prompt.
  11. default=linux Specifies the default image to be booted if none is specified by the user. (If none, use image in first stanza.)

lilo.conf
Here is an example of a lilo.conf file. The delay switch receives a number in tenths of a second. So the delay below is three seconds, not thirty.
boot = /dev/hda
delay = 30
image = /boot/vmlinuz
root = /dev/hda1
label = Red Hat 5.2
image = /boot/vmlinuz
root = /dev/hda2
label = S.U.S.E. 8.0
other = /dev/hda4
table = /dev/hda
label = MS-DOS 6.22

The configration file shows three example stanzas. The first one boots Red Hat from the first partition on the first disk (hda1). The second stanza boots Suse 8.0 from the next partition. The last one loads MS-DOS.

Working with the LILO map installer

After editing your LILO configuration file, test them with /sbin/lilo -t. Assuming LILO does not give you an error message, install your new configuration with /sbin/lilo -v.
If you make a mistake, you can restore your previous copy with
/sbin/lilo -u .

The next lesson concludes this module.

SEMrush Software 11 SEMrush Banner 11