Version magic resolve inconsistencies, can not insert 'xxx.ko' problems

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/fengweibo112/article/details/101059020

When executed insmod, there are mistakes

#insmod code.ko
code: version magic '3.18.0-linux4sam_4.7-YD-5D34-V6-g622a003 mod_unload ARMv7 p2v8 ’ should be '3.18.0-linux4sam_4.7-YD-5D34-V6-gfb5b482-dirty mod_unload ARMv7 p2v8 ’ insmod: can’t insert ‘code.ko’: invalidmodule format
Here Insert Picture Description

Solution:

1. Enter the linux kernel source, found ./include/linux/vermagic.h
Here Insert Picture Description2. In vermagic.h will include a header file, enter the header
Here Insert Picture Description
Here Insert Picture Description
3 can be modified to set a version
Here Insert Picture Description
4. recompiled driver generator. ko, then you can execute insmod.

Guess you like

Origin blog.csdn.net/fengweibo112/article/details/101059020