Upgrade & recompile a kernel steps
download
extract
linux
deps
menuconfig
mdcbmm
system
bzImage
mkinitrd
grub
Where to get the kernel source,
http://www.kernel.org. Select 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 -
Check for dependencies for and install as needed:
kernel-source-*
glibc-kernelheaders-*
cpp-*
ncurses
ncurses-devel-*
binutils-*
gcc-*
rpm -qa | grep “kernel-source”
Then create a symbolic link where linux-2.4.2x was the old link and linux-2.4.2x will be the new.
rm linux-2.4
ln -s linux-2.4.21 linux-2.4
If this is the first time you're building a kernel, start with the kernel configuration template that your system was built with:
cd /boot
ls config*
config-2.4.20-8
cp config-2.4.20-8 /usr/src/linux-2.4/.config
Then you can customize your kernel configuration by typing:
cd /usr/src/linux-2.4
make menuconfig
After customizing the kernel, you can build it:
make dep clean bzImage modules modules_install
Copy the system map and make symbolic link.
cd /usr/src/linux-2.4
cp -p System.map /boot/Sytem.map-2.4.21
rm System.map
ln -s System.map-2.4.21 System.map
What to do after you build a kernel. Copy the resulting kernel to the /boot directory with any name you'd like for it:
cp /usr/src/linux/arch/i386/boot/bzImage /boot/mynewkernel
Create your initrd image, where 2.4.21 is your /lib/2.4.21 directory:
mkinitrd /boot/mynewkernelimage.img 2.4.21
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
Then type: lilo
If your machine is configured to boot with grub then modify /boot/grub/menu.lst file. Here is an example for the /boot/grub/menu.lst file:
title Linux 2.4.20 with all my new configuration
root (hd0,0)
kernel /mynewkernel ro root=LABEL=/
initrd /initrdmnk.img
r00tnuke