Help File Library: An Easier (and Better) Way to Compile Your Kernel on Red Hat-Based Systems
Written By: Percy de Leon (pdeleon at punkass dot com)
Download the latest stable kernel tarball (currently it's linux-2.4.19.tar.bz2, but that could be different as you read this). Save it in your home directory.
Extract/uncompress the kernel tarball. After extracting
the kernel source, change your directory to the kernel
source directory.
tar xjf linux-2.4.19.tar.bz2
cd linux-2.4.19
Enter the following command:
make mrproper
This will remove all the stale .o
files in the source repository. This will also remove all
previous kernel configurations (hey, you want to customize
the kernel yourself, right?)
Configure your kernel. You may do so by doing a make
config, make xconfig, or make menuconfig, or
make oldconfig, which are explained below.
make config will require you to modify the default
kernel configuration (which is the .config file included in
the source tarball).
make xconfig is a better way to GUI-cally configure
your kernel. This requires an X server in order to run.
make menuconfig will let you configure your kernel
using curses. It's like a GUI but runs on top of the
terminal/console.
make oldconfig will let you configure your kernel by
answering yes, no, or module.
So let's use the curses method:
make menuconfig
Configure your kernel as you see fit. If you have some
background knowledge on your hardware, the better.
Compile your kernel. This will involve three easy steps:
compile all the dependencies, create a compressed kernel
image, and compile all the kernel modules.
make dep && make bzImage && make modules
Install the kernel and the kernel modules. You have be
root to do this.
su
make modules_install && make install
make modules will install the kernel modules in your new
kernel. make install, on the other hand, will automagically
modify your grub.conf or lilo.conf file using the
'/sbin/installkernel' script via '$KERNEL_SOURCE/arch/i386/boot/install.sh', which will in
turn use the scripts in '/usr/share/loader' to install the kernel in the boot partition, generate an initrd (if necessary), and add entries to your lilo.conf or grub.conf file.
If you're using grub bootloader, you may proceed to step 7.
Else, if you're using LILO, don't forget that you have to
run lilo before rebooting.
lilo
reboot
Reboot and enjoy! You should now have a new kernel
running on your Red Hat based system.