The source module has it. This is a library that is built and to build it, the makefile needed the obj-m:=junk.o item, when the error comes up, it points to junk as the problem file. I tried just copying my own junk.mod.c but it appears its always overwritten. I just patched the kernel to go back to a warning instead of error and now it's all working fine. On Sun, Jul 31, 2022 at 9:16 PM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote: > > 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