Installation guide
Appendix A. Building a Custom Kernel 249
look similar to EXTRAVERSION = -0.1.21-jul2001). This will allow you to have the
old working kernel and the new kernel, version 2.4.18-0.12-jul2001, on your system at
the same time.
9. Build the kernel with make bzImage.
10. Build any modules you configured with make modules.
11. Use the command make modules_install to install the kernel modules (even if you
did not build any). Make sure that you type the underscore (_). This will install the ker-
nel modules into the directory path /lib/modules/KERNELVERSION/kernel/drivers
(where KERNELVERSION is the version specified in the Makefile). In the example it
would be /lib/modules/2.4.18-0.12-jul2001/kernel/drivers/.
12. If you have a SCSI adapter and you made your SCSI driver modular, build a new
initrd image Also, if you build your kernel with ext3 support as a module (the default
in Red Hat Linux), you must create an initrd image. Refer to Section A.2 for details.
13. Use make install to copy your new kernel and its associated files to the proper direc-
tories.
14. The kernel is built and installed now. The next step is configuring the boot loader to
boot the new kernel. Refer to Section A.3 for more information.
A.2. Making an initrd Image
An initrd image is needed for loading your SCSI module at boot time or if you are compil-
ing the kernel with ext3 support as a module. If you do not need an initrd image, do not
make one and do not edit lilo.conf or grub.conf to include this image.
Use the /sbin/mkinitrd shell script to build an initrd image for your machine. To use this
command, the loopback block device must be available.
To build the new initrd image, run /sbin/mkinitrd with parameters such as this:
/sbin/mkinitrd /boot/initrd-2.4.18-0.12-jul2001.img 2.4.18-0.12-jul2001
In the above example, /boot/initrd-2.4.18-0.12-jul2001.img is the file name of
the new initrd image. 2.4.18-0.12-jul2001 is the kernel whose modules (from
/lib/modules) should be used in the initrd image. This is not necessarily the same as the
version number of the currently running kernel.
A.3. Configuring the Boot Loader
Now that you have recompiled your kernel, you must configure the boot loader to boot
the new kernel. This is a crucial step. If you do not perform this step or if you perform it
incorrectly, you will 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 3 for more information about rescue mode.
In order to provide a redundant boot source to protect from a possible error in a new ker-
nel, you should keep the original kernel available. During the installation of Red Hat Linux
7.3, you had the option to choose either GRUB or LILO as your boot loader. Refer to the
appropriate section that follows.