编译Linux内核模块时报:WARNING: Symbol version dump "Module.symvers" is missing.
2024-07-20
123
问题描述
我在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模块了。
更新于:6个月前赞一波!3
相关文章
- 【说站】php中Swoole的模块介绍
- 【说站】Python中三种模块类型的介绍
- 【说站】python Tkinter模块是什么
- 【说站】python pyglet模块如何使用
- 【说站】python搜索模块如何查询
- 【说站】python如何定义索引模块类
- 【说站】python数据模块类如何定义
- 【说站】python zipfile模块的文件操作
- 【说站】python shutil模块如何操作文件
- 【说站】css中Grid模块是什么
- 【说站】python模块如何安装
- 【说站】Python threading模块的常用方法
- 【说站】python中random模块求随机数
- 【说站】python模块如何传入参数
- 【说站】python模块的介绍和导入
- 【说站】python怎么导入pygame模块
- 【说站】python thread模块如何实现多线程
- 【说站】php安装mysql扩展模块
- 【说站】python模块中判断全局变量的赋值
- 【说站】Python有哪些命令行参数解析模块?
文章评论
评论问答