how to upgrade CentOS kernel


1,wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.4.tar.bz2
2, make mrproper

3, cp /boot/config* .config ; make oldconfig

 or  make defconfig [ use the sample config as the .config file (linux-2.6.24.4/arch/x86/configs/i386_defconfig)]

4, make dep  
5, Make kernel and install
make -j4 bzImage V=1
make -j4 modules V=1 
make modules_install V=1 
6, install others
    cp arch/x86/boot/bzImage       /boo/bzImage-2.6.24
   cp System.map         /boo/System.map-2.6.24 
   mkinitrd /boot/initrd-2.6.24.img  2.6.24.4
7, Add strings below to grub/menu.lst

title CentOS (2.6.24)

        root (hd0,0)

        kernel /bzImage-2.6.24 ro root=/dev/VolGroup00/LogVol00 rhgb quiet

        initrd /initrd-2.6.24.img


8,reboot and select your new kernel

9,有可能需要编辑initrd文件
  解压:

 #  zcat initrd.gz | cpio -ivd --no-absolute-filenames
  打包:
# find . | cpio -o -H newc -F tmp_initrd2
# gzip -f9 tmp_initrd2

参考:

http://www.gentoo.org/doc/en/kernel-upgrade.xml

http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch05.html

posted on 2011-08-25 15:42  Tonystz  阅读(152)  评论(0编辑  收藏  举报