Installation guide

250 Appendix A. Building a Custom Kernel
A.3.1. GRUB
If you selected GRUB as your boot loader, modify /boot/grub/grub.conf. 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-0.12)
root (hd0,0)
kernel /vmlinuz-2.4.18-0.12 ro root=/dev/hda3
initrd /initrd-2.4.18-0.12.img
If you created a separate /boot partition, the paths to the kernel and initrd image are
relative to the /boot partition.
To add your new kernel to GRUB, copy the existing title section to a new one and modify it
to boot your new kernel image (and initrd image if you have any SCSI devices and have
created an initrd image). Be sure the title of the new section is different from the title of
the section to boot the old kernel. 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 would look like 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-0.12-jul2001)
root (hd0,0)
kernel /vmlinuz-2.4.18-0.12-jul2001 ro root=/dev/hda3
initrd /initrd-2.4.18-0.12-jul2001.img
title Red Hat Linux (2.4.18-0.12)
root (hd0,0)
kernel /vmlinuz-2.4.18-0.12 ro root=/dev/hda3
initrd /initrd-2.4.18-0.12.img
The default boot entry is set to number 0. To 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 mod-
ifying the configuration file.
From now on, when the system boots you will see the following GRUB boot options:
Red Hat Linux (2.4.18-0.12-jul2001)
Red Hat Linux (2.4.18-0.12)
To boot the default kernel, press [Enter] or wait for it to time out. If you want to boot the old
kernel, select it and press [Enter].
You can begin testing your new kernel by rebooting your computer and watching the mes-
sages to ensure that your hardware is detected properly.