主题 : REDHAT ENTERPRISE LINUX 5.0 升级内核为linux-2.6.32.5注意事项 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 13675
精华: 0
发帖: 39
金钱: 195 两
威望: 39 点
综合积分: 78 分
注册时间: 2010-01-27
最后登录: 2013-11-11
楼主  发表于: 2010-02-01 08:40

 REDHAT ENTERPRISE LINUX 5.0 升级内核为linux-2.6.32.5注意事项

       昨天把内核升级为最新linux-2.6.32.5出现了很多疑难问题。
    1.首先拷贝配置 cp /boot/config-2.6.18-128-el5 .config
         2.make menuconfig     保存退出,
          使用编辑工具打开.config 修改为CONFIG_SYSFS_DEPRECATED_V2=yes
         不设置将出现以下故障:
*************************************************************************
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!
**************************************************************************
        
         3.make all    编译完成:make install  然后make modules_install
         4.不要重新启动需要修改initrd
1.解压initrd
# cp /boot/initrd-2.6.32.5.img /tmp
# cd /tmp/
# ls
initrd-2.6.32.5.img
# mkdir newinitrd
# cd newinitrd/
# zcat ../initrd-2.6.32.5.img |cpio -i
xxxx blocks
# ls
bin  dev  etc  init  lib  proc  sbin  sys  sysroot
2,编辑init,删掉重复的两行
echo "Loading dm-region-hash.ko module"
insmod /lib/dm-region-hash.ko
echo "Loading dm-region-hash.ko module"
insmod /lib/dm-region-hash.ko
3,重新打包initrd
# find .|cpio -c -o > ../initrd
11538 blocks
# cd ..
# gzip -9 < initrd > initrd-2.6.32.img
# ls
initrd-2.6.32.img      initrd            newinitrd
initrd-2.6.32.img就是重新打包的initrd了,然后把initrd-2.6.35.img拷贝到/boot,然后修改/boot/grub/grub.conf 文件中linux-2.6.32.5中initrd内容为initrd-2.6.35.img。reboot
否则将出以下故障:
insmod: error inserting ‘/lib/dm-region-hash.ko’: –1 File exits