Configuring the Boot Loader

Making sure the boot loader configuration file has been correctly modified is a crucial step. If the file is modified incorrectly, you may not be able to boot your system. If this happens, boot your system with the boot diskette you created earlier and try configuring the boot loader again. If your boot diskette does not work, refer to Chapter 8 for more information about rescue mode.

In order to provide a redundant boot source to protect from a possible error in a new kernel, you should keep the original kernel available. During the installation of Red Hat Linux 8.0, you had the option to choose either GRUB or LILO as your boot loader. Refer to the appropriate section that follows.

GRUB

If you selected GRUB as your boot loader, the new-kernel-pkg script should have modified /boot/grub/grub.conf to include a section for the new kernel.

The default GRUB configuration file looks similar to the following:

# NOTICE:  You have a /boot partition.  This means that
#          all kernel paths are relative to /boot/
default=0
timeout=30
splashimage=(hd0,0)/grub/splash.xpm.gz

title Red Hat Linux (2.4.18-7.95)
        root (hd0,0)
        kernel /vmlinuz-2.4.18-7.95 ro root=/dev/hda3
        initrd /initrd-2.4.18-7.95.img

If you created a separate /boot partition, the paths to the kernel and initrd image are relative to the /boot partition.

By default, Red Hat Linux uses Red Hat Linux and the kernel version in parentheses to differentiate between different kernels for GRUB to boot. In our example, the new /boot/grub/grub.conf file created by the new-kernel-pkg script would look like the following:

# NOTICE:  You have a /boot partition.  This means that
#          all kernel paths are relative to /boot/
default=1
timeout=30
splashimage=(hd0,0)/grub/splash.xpm.gz

title Red Hat Linux (2.4.18-7.95custom)
        root (hd0,0)
        kernel /vmlinuz-2.4.18-7.95custom ro root=/dev/hda3
        initrd /initrd-2.4.18-7.95custom.img

title Red Hat Linux (2.4.18-7.95)
        root (hd0,0)
        kernel /vmlinuz-2.4.18-7.95 ro root=/dev/hda3
        initrd /initrd-2.4.18-7.95.img

Notice that the default boot entry is set to 1. The script does not change the default kernel to boot; it only adds a new section for the new kernel.

If the file is not modified correctly and you did not receive any error messages from make install, add the new section manually.

After rebooting, selecting the new kernel from the list, and seeing that the new kernel works, you can make your new kernel the default. Either place its section first or change the default entry number to the appropriate number (remember that it starts counting with 0). For GRUB, you do not need to run any commands after modifying the configuration file.

LILO

If you selected LILO as your boot loader, the new-kernel-pkg script should have modified /boot/lilo.conf to include a section for the new kernel and run /sbin/lilo.

The default LILO configuration file looks similar to the following:

prompt
timeout=50
default=linux
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32

image=/boot/vmlinuz-2.4.18-7.95
	label=linux
        initrd=initrd-2.4.18-7.95.img
	read-only
	append="root=LABEL=/"

The modified /etc/lilo.conf should look similar to the following:

prompt
timeout=50
default=linux
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32
	
image=/boot/vmlinuz-2.4.18-7.95custom
        label=2.4.18-7.95custom
        initrd=initrd-2.4.18-7.95custom.img
        read-only
        append="root=LABEL=/"

image=/boot/vmlinuz-2.4.18-7.95
       label=linux
       initrd=initrd-2.4.18-7.95.img
       read-only
       append="root=LABEL=/"

If the file is not modified correctly and you did not receive any error messages from make install, add the new section manually.

To activate the changes, run the command /sbin/lilo -v. If all goes well, you will see output similar to the following:

LILO version 21.4-4, Copyright (C) 1992-1998 Werner Almesberger
'lba32' extensions Copyright (C) 1999,2000 John Coffman

Reading boot sector from /dev/hda
Merging with /boot/boot.b
Mapping message file /boot/message
Boot image: /boot/vmlinuz-2.4.18-7.95custom
Added 2.4.18-7.95custom *
Boot image: /boot/vmlinuz-2.4.18-7.95
Added linux
Writing boot sector.

Be sure the messages contains Writing boot sector. The * after linux means that the section labeled linux is the default kernel that LILO will boot.

From now on, when the system boots you will see the old and new entries.

To boot the new kernel, select it and press [Enter].

You can begin testing your new kernel by rebooting your computer and watching the messages to ensure your hardware is detected properly. If it is successful, you can change LILO to boot the new kernel by default by changing the label after default= in the configuration file and running the command lilo -v.