On Mon, Aug 1, 2022 at 2:16 AM David F. <df7729@xxxxxxxxx> wrote: > > Years ago I set up a series of makefiles and bash scripts to build > both a support library for kernel modules and my own kernel modules. > Now years later, I don't recall much about how all this works but it > has until moving to 5.15 (from 5.10. kernels). Although, there was an > issue with it not supporting libraries at some upgrade point, but this > list helped me with a patch so it would build the .a libraries and > link with them. > > Looking at the makefile for building the library it has a note that I > needed to set up a fake obj-m for it to actually build the library. > So what I have is: > > # Setup module name for kbuild > obj-m:=junk.o > junk-objs:=lib.a > > There is no reference to any junk_mod.c file, it appears kbuild > automatically creates the junk-mod.c file itself. The problem is the > build now fails due to the: > ERROR: modpost: missing MODULE_LICENSE() in /.../junk.obj > > Is there some other makefile option to make kbuild set the > MODULE_LICENSE() or perhaps ignore it since it's not needed in this > type of case? You need to add MODULE_LICENSE() somewhere in your module source code. > > Or should I take this junk.mod.c file and now modify it and then > actually copy it over as the actual source to use to force the library > to be created? > > Thanks!! -- Best Regards Masahiro Yamada