Kernel Fundamentals – Part 8
Over the past week or so, you’ve manage to configure and compile a new kernel. You’ve also built and installed the loadable modules that are, in fact, device drivers in Linux. Finally, you’ve moved that new kernel image to the /boot directory and told lilo where to look for the kernel when booting your system. If you’ve had a successful reboot, you’re beginning to understand one of the fundamental joys of Linux.
Today, I have one final tip that will help avoid disaster if your kernel rebuild turns out, for some reason, to be unsuccessful. This tip has been very useful to me, especially during the early days of my Linux use.
Let’s upon the /etc/lilo.conf file one more time with your favorite editor. Add the following stanza below the stanza for your secondary operating system:
In this modification, vmlinuz-2.x.x should be the name of your old kernel image. What does this modification accomplish? It allows you another option in the boot process – the choice of reverting to your old kernel version should the new one fail at boot. Instead of two operating system choices, lilo will present you with three: linux, the secondary OS and an option called “failsafe,” as defined by the “label” line of the new stanza.
One final caveat, as well. Installing the kernel source is not the default in Red Hat. In order to recompile the kernel in Red Hat, you will need to do one of three things: a) make sure to install kernel source during the initial install of your Red Hat Linux system, b) download and install the most recent kernel source package from Kernel.org, or c) install the kernel source from the rpm on the Red Hat install disc after you’ve completed the initial install.
We’ve covered a lot of ground in the kernel series and, with patience, you’ve been successful in building your Linux kernel to your own specifications. If you have remaining questions, you can refer to the Linux Kernel HOWTO. And, in the community spirit of Penguin Shell, you can always share your kernel compilation experiences, good and bad, with all of us. I’ll include your comments and tips in upcoming issues.