内核升级问题

 

//--------------------------------------------------------------
//Author:lanyang123456
//2011-10-15
//--------------------------------------------------------------


前面(http://blog.csdn.net/lanyang123456/article/details/6583254)曾提到2.6.18系统下编译2.6.21内核的问题,在此不赘述。

下面介绍2.6.18或者2.6.21系统下编译2.6.32内核的相关问题。

一般在2.6.18系统下,gcc编译器为4.1.1,编译2.6.32内核会报错:
[root@localhost linux-2.6.32]# make
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-x86
  CC      kernel/bounds.s
In file included from include/linux/compiler-gcc.h:86,
                 from include/linux/compiler.h:40,
                 from include/linux/stddef.h:4,
                 from include/linux/posix_types.h:4,
                 from include/linux/types.h:14,
                 from include/linux/page-flags.h:8,
                 from kernel/bounds.c:9:
include/linux/compiler-gcc4.h:8:4: error: #error Your version of gcc miscompiles the __weak directive
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
通过查看文件include/linux/compiler-gcc4.h
/* GCC 4.1.[01] miscompiles __weak */
#ifdef __KERNEL__
# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
#  error Your version of gcc miscompiles the __weak directive
# endif
#endif

提示,需要gcc4.1.1以上版本

解决方法:(1)升级gcc编译器
(2)屏蔽掉该段代码(本文章采用的方法)

通过以上操作,2.6.18下,编译,安装内核可以顺利完成。
在2.6.21系统下,gcc编译器版本为4.1.2,不会出现以上错误,编译,安装可顺利完成。

2.6.18或者2.6.21系统下编译安装顺利完成后,重启系统。
出现如下错误:

mount: could not find filesystem '/dev/root'
setuproot: moving /dev failed: No such file or directory
setuproot: error mounting /proc: No such file or directory
switchroot: mount failed: No such file or directory
Kernel panic - not syncing: Attempted to kill init!
setuproot: error mounting /sys: No such file or directory


解决方法:

重新配置内核,make menuconfig进入配置表,选择将SYS_DEPRECATED_V2 编译进内核。
即OK。

一般情况下,内核升级时,会出现启动问题。
可能的原因:
(1)SCSI设备驱动没有添加到内核中
(2)与ext3相关项,添加进内核
(3) SYS_DEPRECATED_V2添加进内核

本人能力水平有限,欢迎学习交流。

参考:
http://blog.sina.com.cn/s/blog_57dab0f60100oj1m.html
http://bbs.chinaunix.net/thread-1960786-1-1.html#
http://bbs.chinaunix.net/thread-2178825-3-1.html

转载请注明出处,谢谢合作。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值