I'm currently trying to run a kernel module. This module seems to work fine on various Linux machines, however, when I attempt to run it on a specific machine (namely, CentOS with a kernel version of 2.6), the module fails to start, claiming that I haven't set a module license, and, as a result, not allowing me to use various necessary kernel APIs.
I have set MODULE_LICENSE("GPL") in the bottom of my main source file (the one that contains module_init and module_exit), and as far as all the examples I could find say, that's enough. I should note that my project has multiple files.
I'm kind of stumped, so any help would be appreciated.
For a start, verify that the license info is present in your module object file.
objdump -sj.modinfo yourModule.ko
I just encountered the same issue, which was fixed only after I wrote MODULE_LICENSE("GPL")
at the beginning (after the includes) of every c file which the module's makefile is referring to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With