install kernel module failed issue

运行"insmod abc.ko"报错如下:
abc: version magic '3.0.43 preempt mod_unload ' should be '3.0.43-913-ga691c40-dirty preempt mod_unload '
insmod: cannot insert abc.ko': invalid module format

别人编的正常的module如下:
modinfo /tmp/abc.ko
filename:       /tmp/abc.ko
version:        0.3
license:        GPL
description:    My driver
author:         My name
srcversion:     0EC075B5B322A91D3F296D1
depends:       
vermagic:       3.0.43-913-ga691c40-dirty preempt mod_unload

modinfo abc.ko
filename:       abc.ko
version:        0.3
license:        GPL
description:    My driver
author:         My name
srcversion:     0EC075B5B322A91D3F296D1
depends:       
vermagic:       3.0.43 preempt mod_unload

出错原因:模块版本与内核版本不匹配!

解决办法:进入menuconfig 继续配置General config ->......Local version -> 加入如下内容:“-913-ga691c40-dirty”退出保存为 .config ,重新编译内核OK啦!
注意:继续配置.config的时候也要指定ARCH和交叉编译的toolchain如下:
make ARCH=powerpc CROSS_COMPILE=xxx menuconfig

用dmesg看log.

你可能感兴趣的:(Install)