问题现象如下:
# insmod adc.ko
[ 42.460000] adc: version magic '3.6.5-Broadcom Linux mod_unload ARMv7 p2v8 ' should be '3.6.5Broadcom Linux-g775caac-dirty mod_unload ARMv7 p2v8 '
问题原因:
内核版本号Magic不匹配。
version magic来源追踪:
include/linux/vermagic.h
include/generated/utsrelease.h
include/config/kernel.release
include/config/kernel.release: include/config/auto.conf FORCE
echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" > $@
最终追踪到scripts/setlocalversion脚本
解决办法:
自己研究修改该脚本。以下供参考。
if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
# full scm version string
- res="$res$(scm_version)"
+ # ( afx ) magic version generate modify
+ res="$res"
+#$(scm_version)"
else
# append a plus sign if the repository is not in a clean
# annotated or signed tagged state (as git describe only