Chinaunix

标题: 升级内核的问题 [打印本页]

作者: gzcarlos    时间: 2012-05-30 13:50
标题: 升级内核的问题
我在Redhat5.8 系统是64位的 原内核版本是2.6.18.305 想升级内核到3的版本,下了一个3.3.7的版本后就按照网上教的步骤来做,但在make bzImage的时候就出现了如下的错误:
In file included from /usr/include/sys/time.h:31,
                 from /usr/include/linux/input.h:12,
                 from samples/hidraw/hid-example.c:14:
/usr/include/sys/select.h:78: error: conflicting types for ‘fd_set’
/usr/include/linux/types.h:12: error: previous declaration of ‘fd_set’ was here
In file included from /usr/include/linux/input.h:14,
                 from samples/hidraw/hid-example.c:14:
/usr/include/sys/types.h:46: error: conflicting types for ‘loff_t’
/usr/include/linux/types.h:30: error: previous declaration of ‘loff_t’ was here
/usr/include/sys/types.h:62: error: conflicting types for ‘dev_t’
/usr/include/linux/types.h:13: error: previous declaration of ‘dev_t’ was here
In file included from /usr/include/sys/types.h:133,
                 from /usr/include/linux/input.h:14,
                 from samples/hidraw/hid-example.c:14:
/usr/include/time.h:105: error: conflicting types for ‘timer_t’
/usr/include/linux/types.h:22: error: previous declaration of ‘timer_t’ was here
In file included from /usr/include/linux/input.h:14,
                 from samples/hidraw/hid-example.c:14:
/usr/include/sys/types.h:198: error: conflicting types for ‘int64_t’
/usr/include/linux/types.h:98: error: previous declaration of ‘int64_t’ was here
/usr/include/sys/types.h:204: error: conflicting types for ‘u_int64_t’
/usr/include/linux/types.h:97: error: previous declaration of ‘u_int64_t’ was here
In file included from /usr/include/linux/input.h:14,
                 from samples/hidraw/hid-example.c:14:
/usr/include/sys/types.h:235: error: conflicting types for ‘blkcnt_t’
/usr/include/linux/types.h:114: error: previous declaration of ‘blkcnt_t’ was here
samples/hidraw/hid-example.c: In function ‘bus_str’:
samples/hidraw/hid-example.c:171: error: ‘BUS_VIRTUAL’ undeclared (first use in this function)
samples/hidraw/hid-example.c:171: error: (Each undeclared identifier is reported only once
samples/hidraw/hid-example.c:171: error: for each function it appears in.)

无论在制定内核配置的时候是用原始默认的还是用我自己制定的都会出现以上的错误。我也在网上找了很多资料,比较少人有这样的错误,然而我在kenerl.org上面找到有patch的下载,不知道是否要先打patch才能编译还是怎么的。请高人们指点一下,谢谢
作者: ulovko    时间: 2012-05-30 14:03
你用原来kernel的配置加载原来kernel 肯定没有问题!
新的kernel不知道里面做了哪些修改,你加载旧 配置肯定不行!

作者: gzcarlos    时间: 2012-05-30 14:27
你说的这个我也试过了,就是把原来的那个配置文件复制到新的下面.config 再在make menuconfig的时候导入嘛。依旧还是出现上面的问题回复 2# ulovko


   
作者: ulovko    时间: 2012-05-30 14:29
回复 3# gzcarlos


    晕,您看不懂我说的话么?  
作者: gzcarlos    时间: 2012-05-30 14:46
"你用原来kernel的配置加载原来kernel 肯定没有问题!
新的kernel不知道里面做了哪些修改,你加载旧 配置肯定不行!"

我明白的你的意思,我是想说,无论加载旧配置与否,或者重新定制也好,都试过了,都出现了以上的问题

回复 4# ulovko


   
作者: ulovko    时间: 2012-05-30 14:51
回复 5# gzcarlos


    对 是的,我也在帮你找,但是至今没有找到解决方法。。
作者: gzcarlos    时间: 2012-05-30 15:09
哦,是吗 谢谢了,不知道是不是版本的问题,我从网上搜到的很多成功例子都是说升级到3.2.18的,而并非3.3.7。所以我想用3.2.18来试一下回复 6# ulovko


   
作者: chenyx    时间: 2012-05-30 15:12
会不会是系统的gcc版本不够,导致的?
作者: gzcarlos    时间: 2012-05-30 15:14
在升级之前已经利用yum升级过gcc了回复 8# chenyx


   
作者: chenyx    时间: 2012-05-30 15:15
那就不清楚了,你现在的gcc版本是多少?
你看下内核的文档,看看对gcc有没有要求.
作者: chenyx    时间: 2012-05-30 15:15
那就不清楚了,你现在的gcc版本是多少?
你看下内核的文档,看看对gcc有没有要求.
作者: gzcarlos    时间: 2012-05-30 15:19
这个倒没看过,也谢谢你的提醒回复 10# chenyx


   
作者: dooros    时间: 2012-05-30 22:35
楼主的版本跨度太大了。这样编译内核整个工具链都要升级一遍。
作者: dooros    时间: 2012-05-30 22:37
如果楼主确实对新内核有需求,建议用ubuntu、debian、archlinux、fedora之类的发行版。
作者: gzcarlos    时间: 2012-05-31 10:08
谢谢版主的关注,昨晚找到了另外一遍文章中说明了应该如何升级编译,而且跟这做也成功了,原来编译之前还要做些调整的工作,不过就不知道能否在这里贴出那篇文章的地址回复 13# dooros


   
作者: chenyx    时间: 2012-05-31 10:18
回复 15# gzcarlos


    可以贴链接,贴具体步骤也可以,最好注明转载的地址
作者: gzcarlos    时间: 2012-05-31 11:36
昨晚升级成功的那参考文章,转自百度
http://hi.baidu.com/adomore/blog ... de9ae5503d9269.html
作者: dooros    时间: 2012-05-31 15:28
gzcarlos 发表于 2012-05-31 10:08
谢谢版主的关注,昨晚找到了另外一遍文章中说明了应该如何升级编译,而且跟这做也成功了,原来编译之前还要做 ...


你按照他的步骤走不行?!
作者: gzcarlos    时间: 2012-05-31 22:05
就是可以了,已经成功了回复 18# dooros


   
作者: wede2046    时间: 2012-12-20 14:19
http://d.hatena.ne.jp/ryousanngata/20110922/1316700121
修改一下 内核源码目录下得 samples/Makefile
hw_breakpoint/ kfifo/ kdb/ hidraw/
把最后那个 hidraw/ 去掉就行了


作者: non-style    时间: 2013-03-12 09:59
编译linux-3.x的内核需要centos6.0以上的版本。在kernel hacking里去掉sample kernel code可以解决,那些sample默认引用了系统/usr/include的头文件。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2