侧边栏壁纸
  • 累计撰写 119 篇文章
  • 累计创建 60 个标签
  • 累计收到 7 条评论

目 录CONTENT

文章目录

编译Linux内核模块时报:WARNING: Symbol version dump "Module.symvers" is missing.

码峰
2022-11-02 / 0 评论 / 0 点赞 / 262 阅读 / 390 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-11-03,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

问题描述

我在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模块了。

0

评论区