My FAQ,最新最全的IT技术FAQ
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 未整理篇 | 技术讨论
  当前位置: > 操作系统 > Linux > Linux综合
在SLES9上编译自己的模块
作者:未知 时间:2005-09-13 22:06 出处:Blog.ChinaUnix.net 责编:My FAQ
              摘要:在SLES9上编译自己的模块
我在sles上编译helloworld模块,出现一些问题(rhel、fc上没有出现这样的问题),记录之。

我装了kernel-source之后,编译自己的helloworld模块,发现有如下的错误:
chesnee6:/home/bye/modules # make -C /usr/src/linux/ SUBDIRS=$PWD modules
make: Entering directory `/usr/src/linux-2.6.5-7.139'
Makefile:438: .config: No such file or directory

WARNING: Symbol version dump /usr/src/linux-2.6.5-7.139/Module.symvers is  missing, modules will have CONFIG_MODVERSIONS disabled.

  CC [M]  /home/bye/modules/hello-1.o
/bin/sh: line 1: scripts/basic/fixdep: No such file or directory
make[1]: *** [/home/bye/modules/hello-1.o] Error 1
make: *** [_module_/home/bye/modules] Error 2
make: Leaving directory `/usr/src/linux-2.6.5-7.139'

这时候
需要到/usr/src/linux/下运行一下make menuconfig,不改任何配置出来并保存配置,它就会根据当前平台把对应平台的默认配置copy为.config文件,并生成一下文件。

这时候编译helloworld模块发现刚才的错误已经消失,不过还是有如下的错误:
/bin/sh: line 1: scripts/modpost: No such file or directory
make[1]: *** [__modpost] Error 127
make: *** [modules] Error 2
make: Leaving directory `/usr/src/linux-2.6.5-7.139'

我上网查了一下,发现还需要运行make modules_prepare。然后再编译helloworld模块就可以通过了。

 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 myfaq.com.cn All rights reserved. www.myfaq.com.cn 版权所有