Mastering Red Hat Linux 9 [Electronic resources]

Michael Jang

نسخه متنی -صفحه : 220/ 95
نمايش فراداده

Bootloader Updates

While GRUB is the default bootloader for Red Hat Linux, LILO is still in fairly common use. When you recompile a kernel, you should set up your bootloader to boot from either kernel, as though they were two distinct operating systems. Although bootloader updates aren’t a part of the “make” process, the steps you need to update either bootloader are fairly straightforward.

Updating GRUB

Assuming GRUB is your bootloader, open /etc/grub.conf in the text editor of your choice. If Red Hat Linux is the only operating system on your computer, the key commands are as follows:

default=0
title Red Hat Linux (2.4.20-8)
root (hd0,1)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img

Now take the kernel that you just recompiled. The main compressed kernel file is vmlinuz-2.4 .20-sugaree; the corresponding Initial RAM file is initrd-2.4.20sugaree.img. Since you’ve installed these files in the same /boot directory, none of the other parameters will change. You can add a second stanza with the newly compiled kernel:

default=0
title Red Hat Linux (2.4.20-8)
root (hd0,1)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img
title Red Hat Linux (2.4.20sugaree)
  root (hd0,1)
  kernel /vmlinuz-2.4.20sugaree ro root=LABEL=/
  initrd /initrd-2.4.20sugaree.img

Remember, nothing more is required. When you reboot your computer, you’ll see both titles in the GRUB menu, as shown in Chapter 11.

Figure 12.45: Revised GRUB

Updating LILO

If you use LILO as your bootloader, open /etc/lilo.conf in the text editor of your choice. If Red Hat Linux is the only operating system on your computer, the key commands are as follows:

default=linux
image=/boot/vmlinuz-2.4.20-8
label=linux
initrd=/boot/initrd-2.4.20-8.img
read-only
append="root=LABEL=/"

Now take the kernel that you just recompiled. The main compressed kernel file is vmlinuz-2.4.20sugaree; the corresponding Initial RAM file is initrd-2.4.20sugaree.img. Since you’ve installed these files in the same /boot directory, none of the other parameters will change. You can add a second stanza with the newly compiled kernel:

default=linux
image=/boot/vmlinuz-2.4.20-8
label=linux
initrd=/boot/initrd-2.4.20-8.img
read-only
append="root=LABEL=/"
image=/boot/vmlinuz-2.4.20sugaree
    label=linux-sugaree
    initrd=/boot/initrd-2.4.20sugaree.img
    read-only
     append="root=LABEL=/"

Save your changes. With LILO, you need to run the lilo command to write the changes to the MBR of your hard disk. Since the default setting is linux, LILO will still automatically boot your old kernel unless you specifically select the new one in the LILO boot menu.