linux使用insmod动态加载内核模块时出现disagree about version of symbol module_layout问题

版权声明: https://blog.csdn.net/masterbee/article/details/86593362

使用insmod **.ko时,出现Invalid module format提示,使用dmesg -c查看相应的log,

出现disagree about version of symbol module_layout。

解决方法:

先使用uname -r查看系统的linux版本号,比如我的:

#uname -r

4.2.0-23-generic

再查看该ko源码目录下的Makefile文件,把KDIR这一项改成和系统的一致:

KDIR := /lib/modules/4.2.0-23-generic/build 

保存,make clean,再make

使用生成的ko重新insmod,就没有这个错误了。 

猜你喜欢

转载自blog.csdn.net/masterbee/article/details/86593362
今日推荐