找回密码
 注册
搜索
热搜: 回贴
微赢网络技术论坛 门户 服务器 Linux/BSD 查看内容

内核错scripts/basic/fixdep: No such file or directory

2009-12-20 13:12| 发布者: admin| 查看: 126| 评论: 0|原作者: 云天青

软件环境:2.6.17.14内核版本,在kernel.org上下载后,开始制作arm和x86的交叉编译环境,最后写了一个驱动的demo测试,发现在进行编译驱动的demo的时候,一直报错:Makefile:438: .config: No such file or directory
于是在内核里随便找了个缺少的文件cp arch/arm/configs/s3c2410_defconfig ./.config
然后再make,接着报错:
huyongfu@huyongfu-desktop:~/Develop_Src/char_dev/module$ make
make -C /home/huyongfu/cross_complie/linux-2.6.17.14 SUBDIRS=/home/huyongfu/Develop_Src/char_dev/module modules
make[1]: Entering directory `/home/huyongfu/cross_complie/linux-2.6.17.14'
WARNING: Symbol version dump /home/huyongfu/cross_complie/linux-2.6.17.14/Module.symvers
is missing; modules will have no dependencies and modversions.
Building modules, stage 2.
MODPOST
/bin/sh: scripts/mod/modpost: No such file or directory
make[2]: *** [__modpost] Error 127
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/huyongfu/cross_complie/linux-2.6.17.14'
make: *** [modules] Error 2
这个问题还从来没有遇到过,原来编译内核的时候也没有这种错误,有的网站上说:“在内核下,先执行make modules_prepare,执行完毕再进行make”
我认为这并不是解决该问题的本质原因,导致这个问题的原因是modpost这个可执行文件没有生成,到目录下 %linux/scripts/mod下查看并没有这个文件,所以错误提示:No such file or directory,问题出在编译内核的过程中。因此把内核重新解包,修改makefile,然后重新进行编译,发现这次编译内核的时间明显比上次长,而且生成zImage的文件也比上次的大,但是上次编译的时候makefile确实没有报错误,而且还提示zImage is already,所以有时候不要相信编译器,编译器不报错不等于没错,最相信的还是自己,根据现象找出本质。这个问题也折磨了我两个小时。
编译完内核后再去make我的驱动demo:
huyongfu@huyongfu-desktop:~/Develop_Src/char_dev/module$ make
make -C /home/huyongfu/cross_complie/linux-2.6.17.14 SUBDIRS=/home/huyongfu/Develop_Src/char_dev/module modules
make[1]: Entering directory `/home/huyongfu/cross_complie/linux-2.6.17.14'
CC [M] /home/huyongfu/Develop_Src/char_dev/module/char_dev_example.o
Building modules, stage 2.
MODPOST
CC /home/huyongfu/Develop_Src/char_dev/module/char_dev_example.mod.o
LD [M] /home/huyongfu/Develop_Src/char_dev/module/char_dev_example.ko
make[1]: Leaving directory `/home/huyongfu/cross_complie/linux-2.6.17.14'
已经编译通过。
那么modpos这个文件缺少了,直接导致驱动编译失败,那么这个文件的作用是什么呢?从编译的过程日志中可以看到,他的作用应该是就爱嗯.o文件转成.ko文件的,这样我们用.ko文件才能去内核里insmod。





最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 13:19 , Processed in 0.319115 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部