My Linux Kernel driver (platform driver) contains MODULE_LICENSE ("GPL v2");, but during compilation following warning is printed:
make[1]: Entering directory '/home/me/buildroot/output/build/linux-4.15.16'
LD [M] /home/me/dir/driver_xy.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: modpost: missing MODULE_LICENSE() in /home/me/dir/driver_xy.o
Whats the problem?
The Makefile was incorrect: The module name was equal the source file name. So following works:
#Makefile
obj-m += mymodule.o
mymodule-y := mymodule_main.o driver_xy.o
before/incorrect:
obj-m += mymodule.o
mymodule-y := driver_xy.o
I had to add MODULE_LICENSE("GPL"); at the end of my module.c file and it worked. See also this GitHub issue.
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