Building a new kernel
For most situations, you don't need to be building new kernels. But in case you want to, this section is here to help speed up the process.
This section discusses:
- Where to get the kernel source
- How to build a kernel
- What to do after you build a kernel
- Where to get more information
Where to get the kernel source
When you install Linux, you can specify that you want the kernel source installed. Or you can add the kernel source later from either the Red Hat 9 CD or from rpmfind.
Many people recommend downloading latest stable version
of Linux kernel sources, rather than using the version
shipping with Red Hat, since newer kernels support more
hardware, etc. To download the latest version
see The Linux Kernel Archives at
http://www.kernel.org. The latest
stable version is listed first. Then download the
kernel source archive by clicking on the F (which
stands for Full source):
Then uncompress and extract the kernel source into
/usr/src
on your system:
cd /usr/src
bzcat linux-2.4.20.tar.bz2 | tar xvf -
ln -s linux-2.4.20 linux
How to build a kernel
If this is the first time you're building a kernel on a Red Hat system, it's easiest if you start with Red Hat's kernel sources and with the kernel configuration template that your system was built with: Then you can customize your kernel configuration by typing: After you are finished customizing the kernel, you can build it:What to do after you build a kernel
Copy the resulting kernel to the /boot directory with any name you'd like for it: If your machine is configured to boot with lilo then edit /etc/lilo.conf, and add a reference to your new kernel. Look at other entries in /etc/lilo.conf to determine what disk shoud be used, etc. Here is a sample of what one might add to /etc/lilo.conf:image=/boot/mynewkernel
label=mynewlabel
read-only
root=/dev/hda8
lilo
title Linux 2.4.20 with all my new configuration
root (hd0,1)
kernel /boot/mynewkernel root=/dev/hda2
When you reboot your machine, you will be able to choose to
boot the new kernel.
Where to get more information
- Kernel HOWTO
- The Official Red Hat Linux Customization Guide, Upgrading the Kernel
- GRUB
- Red Hat's Linux Kernel page
- The file /usr/src/linux/Documentation/Configure.help is a low-level file that summarizes the kernel configuration options.
- The file /usr/src/linux/Documentation/devices.txt is a low-level summary of each device on the system