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.
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 Figure 12.45. Since default=0 , the old kernel in the first stanza is still the default. We described a similar version of grub.conf in Figure 12.2 . For a detailed analysis of GRUB, see Chapter 11 .
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.