编译Linux内核模块时报:WARNING: Symbol version dump "Module.symvers" is missing.
2024-07-20
73
问题描述
我在OpenSUSE Linux中运行make构建一个自定义驱动程序,用于与一些外部设备进行通讯,Makefile在其他Linux系统中make都正常,但就在Open SUSE中编译报警告:WARNING: Symbol version dump “Module.symvers” is missing. 和错误:/bin/sh: scripts/mod/modpost: No such file or directory,详细如下:
~/p/func sudo make -k
make -C /lib/modules/uname -r/build M=/home/name/programs/func/driver
make[1]: Entering directory /usr/src/linux-5.14.21-150400.22-obj/x86_64/default
WARNING: Symbol version dump Module.symvers is missing.
Modules may not have dependencies or modversions.
You may get many unresolved symbol warnings.
MODPOST /home/name/programs/func/driver/Module.symvers
/bin/sh: scripts/mod/modpost: No such file or directory
make[3]: *** [/usr/src/linux-5.14.21-150400.22/scripts/Makefile.modpost:156: /home/name/programs/func/driver/Module.symvers] Error 127
make[3]: Target __modpost not remade because of errors.
make[2]: *** [/usr/src/linux-5.14.21-150400.22/Makefile:1797: modules] Error 2
make[2]: Target __all not remade because of errors.
make[1]: *** [/usr/src/linux-5.14.21-150400.22/Makefile:220: __sub-make] Error 2
make[1]: Target __all not remade because of errors.
make[1]: Leaving directory /usr/src/linux-5.14.21-150400.22-obj/x86_64/default
make: *** [Makefile:19: driver] Error 2
make -C apps
make[1]: Entering directory /home/name/programs/func/apps
make[1]: Nothing to be done for all.
make[1]: Leaving directory /home/name/programs/func/apps
make: Target all not remade because of errors.
解决办法
在内核目录/usr/src/linux-5.14.21-150400.22-obj/x86_64/default中执行以下命令:
sudo make scripts
然后执行安装:
sudo zypper install kernel-default-devel
再编译就能够正常生成.ko模块了。
更新于:4个月前赞一波!
相关文章
- 【说站】python中random模块求随机数
- 【说站】python模块如何传入参数
- 【说站】python模块的介绍和导入
- 【说站】python怎么导入pygame模块
- 【说站】python thread模块如何实现多线程
- 【说站】php安装mysql扩展模块
- 【说站】python模块中判断全局变量的赋值
- 【说站】Python有哪些命令行参数解析模块?
- 【说站】python vim模块的函数接口
- Vue 网络请求模块封装 (axios)
- 微擎安装模块时提示 Failed to connect to we7.rewlkj.com port 80: Timed out
- Python 中的 AppJar 模块
- c++运行时报错误:there is a mismatch in alloc and dealloc
- 使用Python的wifi模块连接到您的WiFi
- 在 Python 中使用 Arcade 模块创建雪效果
- git push时报remote rejected shallow update not allowed 的问题
- Python教程:利用cv2模块识别手势
- Python 模块:解锁代码的模块化魔力
- 解决Python中模块版本冲突的烦恼
- 解决Python开发中的模块冲突问题
文章评论
评论问答