当前位置: 技术问答>linux和unix
再问一个关于EXPORT_SYMBOL的问题
来源: 互联网 发布时间:2016-01-02
本文导语: 前几天我提问了关于EXPORT_SYMBOL的问题: http://community.csdn.net/Expert/topic/5244/5244619.xml?temp=.8771784 现在又遇到了一个问题,当insmod第二个模块时出现“test: no version for "print" found: dernel tainted”。两个文件(dpc.c和test.c)...
前几天我提问了关于EXPORT_SYMBOL的问题:
http://community.csdn.net/Expert/topic/5244/5244619.xml?temp=.8771784
现在又遇到了一个问题,当insmod第二个模块时出现“test: no version for "print" found: dernel tainted”。两个文件(dpc.c和test.c)后面我都加上了MODULE_LICENSE("Dual BSD/GPL");,可还是不行,上面这句话属于kernel/module.c里面“check_version”这个函数。使用“cat /proc/sys/kernel/tainted”可以查看tainted具体的值,关于tainted在/Documentation/sysctl/kernel.txt中又说明:
tainted:
Non-zero if the kernel has been tainted. Numeric values, which can be ORed together:
1 - A module with a non-GPL license has been loaded, this includes modules with no license.Set by modutils >= 2.4.9 and module-init-tools.
2 - A module was force loaded by insmod -f. Set by modutils >= 2.4.9 and module-init-tools.
4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.
我用的是redhat enterprise 4,系统启动时可以看到tainted的值已经是1了,insmod第一个模块(print.ko)后,tainted的值仍然是1,当insmod第二个模块(test.ko)后,tainted的值就变成3了。上面说到“test: no version for "print" found: dernel tainted”,这里的version是不是说明print这个函数没有指定在那个版本的内核上用。怎么解决这个问题?(2.6内核下没EXPORT_SYMBOL_NOVERS,也没有/include/linux/modversions.h)
http://community.csdn.net/Expert/topic/5244/5244619.xml?temp=.8771784
现在又遇到了一个问题,当insmod第二个模块时出现“test: no version for "print" found: dernel tainted”。两个文件(dpc.c和test.c)后面我都加上了MODULE_LICENSE("Dual BSD/GPL");,可还是不行,上面这句话属于kernel/module.c里面“check_version”这个函数。使用“cat /proc/sys/kernel/tainted”可以查看tainted具体的值,关于tainted在/Documentation/sysctl/kernel.txt中又说明:
tainted:
Non-zero if the kernel has been tainted. Numeric values, which can be ORed together:
1 - A module with a non-GPL license has been loaded, this includes modules with no license.Set by modutils >= 2.4.9 and module-init-tools.
2 - A module was force loaded by insmod -f. Set by modutils >= 2.4.9 and module-init-tools.
4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.
我用的是redhat enterprise 4,系统启动时可以看到tainted的值已经是1了,insmod第一个模块(print.ko)后,tainted的值仍然是1,当insmod第二个模块(test.ko)后,tainted的值就变成3了。上面说到“test: no version for "print" found: dernel tainted”,这里的version是不是说明print这个函数没有指定在那个版本的内核上用。怎么解决这个问题?(2.6内核下没EXPORT_SYMBOL_NOVERS,也没有/include/linux/modversions.h)
|
MODULE_LICENSE("GPL");