linux内核升级centos



linux内核升级centos
 
 喜新厌旧不是一个贬义词!比如,对于linux来说~
        虚拟机上装了一个centos 5.5,内核是2.6.18的。本着与时俱进的党的号召,闲的时候我想把我的内核升级一下了!于是度娘了一番,可是事情总是不能按照预期的轨迹走,生活却还得继续,自己摸索吧!
  www.2cto.com  
        为了不由太大的跨越,我选择了升级到2.6.19.
        1、在ftp://ftp.kernel.org/pub/linux/kernel/v2.6 上下载了2.6.19的内核linux-2.6.19.tar.bz2
        2、cp  linux-2.6.19.tar.bz2 /usr/src/kernel/ cp到/usr/src/kernel下 (有的发行版本没有kernel目录)
        3、tar -jxvf linux-2.6.19.tar.bz2 解压到当前目录
 
        4、配置内核。我建议有两种方法
                a、直接make menuconfig,然后quit,save
                b、把/boot/config-2.6.18 直接cp到根目录下为.config
        5、make
        6、make bzImage
        7、make modules
        8、make modules_install
        9、mkinitrd /boot/initrd-2.6.19 2.6.19
        10、cp /usr/src/kernel/linux-2.6.19/arch/i386/boot/bzImage /boot/vmlinuz-2.6.19  www.2cto.com  
        11、vim /boot/grub/grub.conf
    
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=15
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu  www.2cto.com  
title CentOS (2.6.18-194.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-194.el5.img
 
在后面添加自己的启动项和内核
        title CentOS (2.6.19-lin)
root (hd0,0)
kernel /vmlinuz-2.6.19 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.19.img
 
OK,大功告成,reboot就可以啦!


 

相关内容

    暂无相关文章