[How To] Compile Kernel (CentOS 2.6.19)

Download Kernel from http://kernel.org Extract package

tar xjf linux-2.6.19.tar.bz2
cd linux-2.6.19

Modify /etc/modprobe.conf to avoid error message

mcedit /etc/modprobe.conf

Comment mptscsi (if exists)

alias eth0 pcnet32
alias scsi_hostadapter mptbase
#alias scsi_hostadapter1 mptscsi
alias scsi_hostadapter2 mptfc
alias scsi_hostadapter3 mptspi
alias scsi_hostadapter4 mptsas
alias scsi_hostadapter5 mptscsih
make mrproper
make clean
make menuconfig
cp /boot/config-`uname -r` .config

Then Select – Load an alternative Configuration File (.config) press enter Select – General Setup ->Type


Then exit, (close app) Selete YES when question do you want to save …?

make rpm
ls -l /usr/src/redhat/SRPMS/
ls -l /usr/src/redhat/RPMS/i386/
cd /usr/src/redhat/RPMS/i386/
rpm -ivh --nodeps kernel-2.6.19default-1.i386.rpm

Now install the new kernel, and create ramdisk:

echo "DMRAID=no" > /etc/sysconfig/mkinitrd/noraid
chmod 755 /etc/sysconfig/mkinitrd/noraid
mkinitrd /boot/initrd-2.6.19.default.img 2.6.19-default

Open file, and put this 4 lines on top of the 2 similar lines.

mcedit /etc/grub.conf

Title CentOS 5.2/U-5.3 (2.6.19-default) root (hd0,0) kernel /vmlinuz-2.6.19-default ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.19.default.img Change the `default=1` to `default=0` on the top of the text. Now configure the grub boot loader via vim command and add the following text in the end of the file:

shutdown -r -n now

All is complate.

uname -r

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.