免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2364 | 回复: 4
打印 上一主题 下一主题

内核编译求教 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-30 21:52 |只看该作者 |倒序浏览
问题1:内核编译是驱动开发的先决条件么?





问题2我的内核编译,使用VMware6 redhat9的linux 本身带2.4.20.8的内核进行 linux-2.6.20.4.tar.gz 编译  在make bzImage是出现问题 困扰比较久了请指点

[root@localhost root]# cd /usr/src/redhat                        进入规范文件目录下
[root@localhost redhat]# ls
BUILD  modutils-2.4.5-1.src.rpm  RPMS  SOURCES  SPECS  SRPMS
[root@localhost redhat]# rpm -e --nodeps modutils                 强行卸载原有的modutilsRPM包

[root@localhost redhat]# rpm -ivh modutils-2.4.5-1.src.rpm        (把源代码包安装到了/usr/src/redhat目录下)
warning: user kaos does not exist - using root
warning: group ocs does not exist - using root
warning: user kaos does not exist - using root
warning: group ocs does not exist - using root
   1:modutils               ########################################### [100%]

[root@localhost redhat]# cd SPECS

[root@localhost SPECS]# rpmbuild --bb modutils.spec                                强行卸载原有的modutilsRPM包
.....................
..................
................
[root@localhost SPECS]# cd ../RPMS/i386                                        转入刚生成的二进制的RPM包所在位置

[root@localhost i386]# rpm -ivh modutils*.rpm                                刚生成两个[modutils-2.4.5.1-1.i386.rpm与modutils-debuginfo-2.4.5.1-1.i386.rpm]二进制的RPM包,一起安装
Preparing...                ########################################### [100%]
   1:modutils-debuginfo     ########################################### [ 50%]
   2:modutils               ########################################### [100%]

[root@localhost i386]# cd /usr/src
[root@localhost src]# ls
debug  linux-2.4  linux-2.4.20-8  module-init-tools-3.2.2.tar.bz2  redhat         (  module-init-tools安放目录)


安装module-init-tools. 它会替代depmod [/sbin/depmod]和其他工具.

[root@localhost src]# tar -jxvf module-init-tools-3.2.2.tar.bz2
[root@localhost src]# cd module-init-tools-3.2.2

[root@localhost module-init-tools-3.2.2]# ./configure --prefix=/sbin

[root@localhost module-init-tools-3.2.2]# make
[root@localhost module-init-tools-3.2.2]# make install

[root@localhost module-init-tools-3.2.2]# ./generate-modprobe.conf /etc/modprobe.conf


[root@localhost module-init-tools-3.2.2]# cd /usr/src
[root@localhost src]# ls
debug      linux-2.4.20-8       module-init-tools-3.2.2          redhat
linux-2.4  linux-2.6.20.4.tar.gz   module-init-tools-3.2.2.tar.bz2


tar –zvxf linux-2.6.20.4.tar.gz
ln –s linux-2.6.20.4 linux
cd linux
make mrproper


方法1:
make menuconfig (我没有修改采用默认的设置)
make  bzImage >/dev/null

kernel/power/pm.c:205: warning: `pm_register' is deprecated (declared at kernel/power/pm.c:64)
kernel/power/pm.c:205: warning: `pm_register' is deprecated (declared at kernel/power/pm.c:64)
kernel/power/pm.c:206: warning: `pm_send_all' is deprecated (declared at kernel/power/pm.c:180)
kernel/power/pm.c:206: warning: `pm_send_all' is deprecated (declared at kernel/power/pm.c:180)
drivers/base/core.c: In function `device_add_attrs':
drivers/base/core.c:251: warning: `i' might be used uninitialized in this function
drivers/net/r8169.c: In function `rtl8169_xmit_frags':
drivers/net/r8169.c:2230: warning: `txd' might be used uninitialized in this function
BFD: Warning: Writing section `.bss' to huge (ie negative) file offset 0xc053e000.
objcopy: arch/i386/boot/compressed/vmlinux.bin: File truncated
make[2]: *** [arch/i386/boot/compressed/vmlinux.bin] Error 1
make[1]: *** [arch/i386/boot/compressed/vmlinux] Error 2


方法2 make menuconfig 进行了一部分配置
make  bzImage >/dev/null

drivers/base/core.c: In function `device_add_attrs':
drivers/base/core.c:251: warning: `i' might be used uninitialized in this function
BFD: Warning: Writing section `.bss' to huge (ie negative) file offset 0xc0241000.
objcopy: arch/i386/boot/compressed/vmlinux.bin: File truncated
make[2]: *** [arch/i386/boot/compressed/vmlinux.bin] Error 1
make[1]: *** [arch/i386/boot/compressed/vmlinux] Error 2
make: *** [bzImage] Error 2

论坛徽章:
36
IT运维版块每日发帖之星
日期:2016-04-10 06:20:00IT运维版块每日发帖之星
日期:2016-04-16 06:20:0015-16赛季CBA联赛之广东
日期:2016-04-16 19:59:32IT运维版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-19 06:20:00每日论坛发贴之星
日期:2016-04-19 06:20:00IT运维版块每日发帖之星
日期:2016-04-25 06:20:00IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-13 06:20:00IT运维版块每日发帖之星
日期:2016-05-28 06:20:00每日论坛发贴之星
日期:2016-05-28 06:20:00
2 [报告]
发表于 2008-12-31 18:55 |只看该作者
你在rh9上编译2.6的内核啊。建议在2.6的发行版上编译2.6的内核。

论坛徽章:
0
3 [报告]
发表于 2008-12-31 22:30 |只看该作者
求教方法或者提示,软件之类的

论坛徽章:
36
IT运维版块每日发帖之星
日期:2016-04-10 06:20:00IT运维版块每日发帖之星
日期:2016-04-16 06:20:0015-16赛季CBA联赛之广东
日期:2016-04-16 19:59:32IT运维版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-19 06:20:00每日论坛发贴之星
日期:2016-04-19 06:20:00IT运维版块每日发帖之星
日期:2016-04-25 06:20:00IT运维版块每日发帖之星
日期:2016-05-06 06:20:00IT运维版块每日发帖之星
日期:2016-05-08 06:20:00IT运维版块每日发帖之星
日期:2016-05-13 06:20:00IT运维版块每日发帖之星
日期:2016-05-28 06:20:00每日论坛发贴之星
日期:2016-05-28 06:20:00
4 [报告]
发表于 2008-12-31 23:03 |只看该作者

回复 #3 whlflang 的帖子


建议LZ直接使用2.6内核的发行版,然后在此基础上重新编译内核

论坛徽章:
0
5 [报告]
发表于 2009-01-01 22:49 |只看该作者

回复 #1 whlflang 的帖子

LZ要升级gcc的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP