All of lore.kernel.org
 help / color / mirror / Atom feed
* kbuild self-created module file errors with: ERROR: modpos: missing MODULE_LICENSE
@ 2022-07-31 17:16 David F.
  2022-08-01  4:14 ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: David F. @ 2022-07-31 17:16 UTC (permalink / raw)
  To: Linux Kbuild mailing list

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?

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!!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: kbuild self-created module file errors with: ERROR: modpos: missing MODULE_LICENSE
  2022-07-31 17:16 kbuild self-created module file errors with: ERROR: modpos: missing MODULE_LICENSE David F.
@ 2022-08-01  4:14 ` Masahiro Yamada
  2022-08-02  4:56   ` David F.
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2022-08-01  4:14 UTC (permalink / raw)
  To: David F.; +Cc: Linux Kbuild mailing list

On Mon, Aug 1, 2022 at 2:16 AM David F. <df7729@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: kbuild self-created module file errors with: ERROR: modpos: missing MODULE_LICENSE
  2022-08-01  4:14 ` Masahiro Yamada
@ 2022-08-02  4:56   ` David F.
  0 siblings, 0 replies; 3+ messages in thread
From: David F. @ 2022-08-02  4:56 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kbuild mailing list

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@kernel.org> wrote:
>
> On Mon, Aug 1, 2022 at 2:16 AM David F. <df7729@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-02  4:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-31 17:16 kbuild self-created module file errors with: ERROR: modpos: missing MODULE_LICENSE David F.
2022-08-01  4:14 ` Masahiro Yamada
2022-08-02  4:56   ` David F.

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.