I have a LKM named RtmNetlinkLKM.c
and compiles and run fine. The moment I update its Makefile to compile with other src files, it starts giving warning:
WARNING: modpost: missing MODULE_LICENSE()
The following MODULE_LICENSE("GPL");
is already present in kernel module file.
Previous Makefile, module compiles fine
obj-m += RtmNetlinkLKM.oall: make -C /lib/modules/`uname -r`/build M=$(PWD) modulesclean: make -C /lib/modules/`uname -r`/build M=$(PWD) clean
updated Makefile, module now compiles with a warning
obj-m += RtmNetlinkLKM.oRtmNetlinkLKM-objs += rt_kern.o gluethread/glthread.o << Added two more sourcesall: make -C /lib/modules/`uname -r`/build M=$(PWD) modulesclean: make -C /lib/modules/`uname -r`/build M=$(PWD) clean rm -f rt_kern.o rm -f gluethread/glthread.o
When compiled using second Makefile, it gives stated warning. When I add MODULE_LICENSE("GPL")
in gluethread/glthread.c
, warning goes away. I don't understand, why do I need to add "GPL" license in glthread.c
when it is not a module but contain functions to be used by module (It is a linked list mini-library). Why doesn't it complain with other src file rt_kern.c
in a similar way. I had never made any changes in original module file RtmNetlink.c
throughout this process.