Receiving the message “module license” unspecified “paint core” despite setting MODULE_LICENSE

I am currently trying to start a kernel module. This module works fine on different Linux machines, however, when I try to run it on a specific computer (namely CentOS with kernel version 2.6), the module does not start, claiming that I did not install the license module and, as a result, preventing me from using various kernel APIs needed.

I set MODULE_LICENSE ("GPL") at the bottom of my main source file (the one that contains module_init and module_exit), and as far as I can tell, all the examples I found are enough. I should note that my project has several files.

I'm a little dumb, so any help would be appreciated.

+4
source share
3 answers

Ok, I realized what I did wrong. I tried to enable the -Werror flag for my module compilation. In doing so, I added the following line to the make file:

CFLAGS_MODULE = -Werror

I guess this messed up something about licensing the kernel module. Removing this line made the module work again. If you have this problem, make sure that you do not bother with environment variables in your makefile.

+2
source

First, make sure that the license information is present in your module object file.

objdump -sj.modinfo yourModule.ko

+3
source

I just ran into the same problem that was only fixed after I wrote MODULE_LICENSE("GPL") at the beginning (after inclusion) of each c file referenced by the makefile.

+2
source

Source: https://habr.com/ru/post/1483310/


All Articles