public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* MODULE_LICENSE("GPL") not working for me
@ 2011-10-06 22:02 Stephen Williams
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Williams @ 2011-10-06 22:02 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1911 bytes --]

I have some large drivers for use in embedded arm systems, and
I want them to be GPL, because I want to use some symbols exported
as GPL, and also because I just wanna. But it is not working for
me. I've attached my Makefile. I'm building from outside the kernel
tree, but that should be OK. I'm using the following script to
actually build:

  SE0=/home/u/wing/steve/picturel/SE0

CROSS_COMPILE=/opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-

  export CROSS_COMPILE
  make KERNELDIR=$SE0/linux-2.6.33-quatro ARCH=arm modules

But no matter what I do, when I try to load my module, I get
errors line this:

  # insmod ./vidfor2.ko
  vidfor: module license 'unspecified' taints kernel.
  Disabling lock debugging due to kernel taint
  vidfor: Unknown symbol driver_remove_file
  vidfor: Unknown symbol driver_create_file
  insmod: can't insert './vidfor2.ko': unknown symbol in module or
invalid parameter

I have a MODULE_LICENSE("GPL"); line in the "linux.c" source file,
and the pertinent parts of the makefile are here:

  OBJ := linux.o ops.o console.o sysfs.o ident_tables.o
  LIBOBJ := vidforio.o init.o format.o video.o isr.o version.o

  ifneq ($(KERNELRELEASE),)

  EXTRA_CFLAGS += -I$(M)/../libvidforio
  obj-m += vidfor.o
  vidfor-objs := $(OBJ) $(patsubst %,../libvidforio/%,$(LIBOBJ))

  else
  [...]

What's the trick for getting the MODULE_LICENSE successfully stamped
into my generated .ko file?

I've googled the list and the internet in general, and found
as many relevant examples as I could in the kernel source, but
I'm at wit's end. I'm not subscribed, so please CC responses,
although I will check back often.

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
http://www.icarus.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

[-- Attachment #2: Makefile --]
[-- Type: text/plain, Size: 898 bytes --]



OBJ := linux.o ops.o console.o sysfs.o ident_tables.o
LIBOBJ := vidforio.o init.o format.o video.o isr.o version.o

ifneq ($(KERNELRELEASE),)

EXTRA_CFLAGS += -I$(M)/../libvidforio
obj-m += vidfor.o
vidfor-objs := $(OBJ) $(patsubst %,../libvidforio/%,$(LIBOBJ))

else

KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

version ident_tables.c:
	@echo ' /* MACHINE GENERATED -- DO NOT EDIT */' > tmp.c
	@echo 'const char vidfor_build_stamp[] =' >> tmp.c
	@echo '"'`git describe --tags --long --always --match sys-\*`'";' >> tmp.c
	@diff tmp.c ident_tables.c > /dev/null 2>&1 || (echo "updating ident_tables.c"; cp tmp.c ident_tables.c)
	@rm -f tmp.c

modules:
	$(MAKE) -C ../libvidforio version
	$(MAKE) version
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

modules_install:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

endif

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

* MODULE_LICENSE("GPL") not working for me
@ 2011-10-06 22:30 Stephen Williams
  2011-10-07  9:52 ` Arnd Bergmann
  2011-10-07 17:20 ` Stephen Williams
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Williams @ 2011-10-06 22:30 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]

I have some large drivers for use in embedded arm systems, and
I want them to be GPL, because I want to use some symbols exported
as GPL, and also because I just wanna. But it is not working for
me. I've attached my Makefile. I'm building from outside the kernel
tree, but that should be OK. (right?) I'm using the following script to
actually build:

SE0=/home/u/wing/steve/picturel/SE0
CROSS_COMPILE=/opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-
export CROSS_COMPILE
make KERNELDIR=$SE0/linux-2.6.33-quatro ARCH=arm modules

But no matter what I do, when I try to load my module, I get
errors line this:

# insmod ./vidfor2.ko
vidfor: module license 'unspecified' taints kernel.
Disabling lock debugging due to kernel taint
vidfor: Unknown symbol driver_remove_file
vidfor: Unknown symbol driver_create_file
insmod: can't insert './vidfor2.ko': unknown symbol in module or
invalid parameter

I have a MODULE_LICENSE("GPL"); line in the "linux.c" source file,
and the pertinent parts of the makefile are here:

OBJ := linux.o ops.o console.o sysfs.o ident_tables.o
LIBOBJ := vidforio.o init.o format.o video.o isr.o version.o

ifneq ($(KERNELRELEASE),)

EXTRA_CFLAGS += -I$(M)/../libvidforio
obj-m += vidfor.o
vidfor-objs := $(OBJ) $(patsubst %,../libvidforio/%,$(LIBOBJ))

else
[...]

What's the trick for getting the MODULE_LICENSE successfully stamped
into my generated .ko file?

I've googled the list and the internet in general, and found
as many relevant examples as I could in the kernel source, but
I'm at wit's end. I'm not subscribed, so please CC responses,
although I will check back often.



-- 
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
http://www.icarus.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

[-- Attachment #2: Makefile --]
[-- Type: application/octet-stream, Size: 904 bytes --]



DRVOBJ := linux.o ops.o console.o sysfs.o ident_tables.o
LIBOBJ := vidforio.o init.o format.o video.o isr.o version.o

ifneq ($(KERNELRELEASE),)

EXTRA_CFLAGS += -I$(M)/../libvidforio
obj-m += vidfor.o
vidfor-objs := $(DRVOBJ) $(patsubst %,../libvidforio/%,$(LIBOBJ))

else

KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

version ident_tables.c:
	@echo ' /* MACHINE GENERATED -- DO NOT EDIT */' > tmp.c
	@echo 'const char vidfor_build_stamp[] =' >> tmp.c
	@echo '"'`git describe --tags --long --always --match sys-\*`'";' >> tmp.c
	@diff tmp.c ident_tables.c > /dev/null 2>&1 || (echo "updating ident_tables.c"; cp tmp.c ident_tables.c)
	@rm -f tmp.c

modules:
	$(MAKE) -C ../libvidforio version
	$(MAKE) version
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

modules_install:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

endif

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

* Re: MODULE_LICENSE("GPL") not working for me
  2011-10-06 22:30 Stephen Williams
@ 2011-10-07  9:52 ` Arnd Bergmann
  2011-10-07 17:20 ` Stephen Williams
  1 sibling, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2011-10-07  9:52 UTC (permalink / raw)
  To: Stephen Williams; +Cc: linux-kernel

On Friday 07 October 2011, Stephen Williams wrote:
> 
> I have some large drivers for use in embedded arm systems, and
> I want them to be GPL, because I want to use some symbols exported
> as GPL, and also because I just wanna. But it is not working for
> me. I've attached my Makefile. I'm building from outside the kernel
> tree, but that should be OK. (right?) I'm using the following script to
> actually build:

It's usually much easier to build from within the kernel tree.
Just put the driver into the drivers/staging directory and use
the regular Makefile/Kconfig logic to hook it up with the build
system.

	Arnd

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

* Re: MODULE_LICENSE("GPL") not working for me
  2011-10-06 22:30 Stephen Williams
  2011-10-07  9:52 ` Arnd Bergmann
@ 2011-10-07 17:20 ` Stephen Williams
  2011-10-07 18:18   ` Sam Ravnborg
  1 sibling, 1 reply; 7+ messages in thread
From: Stephen Williams @ 2011-10-07 17:20 UTC (permalink / raw)
  To: linux-kernel

On Thu, Oct 6, 2011 at 3:30 PM, Stephen Williams <steveicarus@gmail.com> wrote:
> I have some large drivers for use in embedded arm systems, and
> I want them to be GPL, because I want to use some symbols exported
> as GPL, and also because I just wanna. But it is not working for
> me. I've attached my Makefile. I'm building from outside the kernel
> tree, but that should be OK. (right?) I'm using the following script to
> actually build:

More information: I can see that the vidfor.o object file, indeed
none of my *.o files, have a .modinfo section. In other situations
where the licens stamp works, the .modinfo section is present.
I'm using the CodeSourcery build of the arm toolchain, and in
the simple cases (module that is a single source file) the
modinfo information works. Hmm...


-- 
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
http://www.icarus.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

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

* Re: MODULE_LICENSE("GPL") not working for me
  2011-10-07 17:20 ` Stephen Williams
@ 2011-10-07 18:18   ` Sam Ravnborg
  2011-10-08  0:36     ` Stephen Williams
  0 siblings, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2011-10-07 18:18 UTC (permalink / raw)
  To: Stephen Williams; +Cc: linux-kernel

On Fri, Oct 07, 2011 at 10:20:46AM -0700, Stephen Williams wrote:
> On Thu, Oct 6, 2011 at 3:30 PM, Stephen Williams <steveicarus@gmail.com> wrote:
> > I have some large drivers for use in embedded arm systems, and
> > I want them to be GPL, because I want to use some symbols exported
> > as GPL, and also because I just wanna. But it is not working for
> > me. I've attached my Makefile. I'm building from outside the kernel
> > tree, but that should be OK. (right?) I'm using the following script to
> > actually build:
> 
> More information: I can see that the vidfor.o object file, indeed
> none of my *.o files, have a .modinfo section. In other situations
> where the licens stamp works, the .modinfo section is present.
> I'm using the CodeSourcery build of the arm toolchain, and in
> the simple cases (module that is a single source file) the
> modinfo information works. Hmm...

I lost the original mail...
Could you try to post the output of make V=2 when you build your module
and the Makefile fragment again.

	Sam

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

* Re: MODULE_LICENSE("GPL") not working for me
  2011-10-07 18:18   ` Sam Ravnborg
@ 2011-10-08  0:36     ` Stephen Williams
  2011-10-09  8:17       ` Sam Ravnborg
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Williams @ 2011-10-08  0:36 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1977 bytes --]

I've attached the Makefile as I have it so far, and I've also attached the
output from make ... V=2. The Makefile is a canonical multi-object-file
module makefile, with some extra trappings for version stamping
and my source code management.

When I look at the object files, NONE of the generated *.o files contains
a .modinfo section, even though there are MODULE_LICENSE("GPL");
lines in the linux.c source file.

Incidentally, the source files in the ../libvidforio directory are generic,
so do not include any kernel header files.

On Fri, Oct 7, 2011 at 11:18 AM, Sam Ravnborg <sam@ravnborg.org> wrote:
> On Fri, Oct 07, 2011 at 10:20:46AM -0700, Stephen Williams wrote:
>> On Thu, Oct 6, 2011 at 3:30 PM, Stephen Williams <steveicarus@gmail.com> wrote:
>> > I have some large drivers for use in embedded arm systems, and
>> > I want them to be GPL, because I want to use some symbols exported
>> > as GPL, and also because I just wanna. But it is not working for
>> > me. I've attached my Makefile. I'm building from outside the kernel
>> > tree, but that should be OK. (right?) I'm using the following script to
>> > actually build:
>>
>> More information: I can see that the vidfor.o object file, indeed
>> none of my *.o files, have a .modinfo section. In other situations
>> where the licens stamp works, the .modinfo section is present.
>> I'm using the CodeSourcery build of the arm toolchain, and in
>> the simple cases (module that is a single source file) the
>> modinfo information works. Hmm...
>
> I lost the original mail...
> Could you try to post the output of make V=2 when you build your module
> and the Makefile fragment again.
>
>        Sam
>



-- 
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
http://www.icarus.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

[-- Attachment #2: make.out --]
[-- Type: application/octet-stream, Size: 2194 bytes --]

make -C ../libvidforio version
make[1]: Entering directory `/home/u/wing/steve/picturel/SE0/vidfor/libvidforio'
make[1]: Leaving directory `/home/u/wing/steve/picturel/SE0/vidfor/libvidforio'
make version
make[1]: Entering directory `/home/u/wing/steve/picturel/SE0/vidfor/sys'
make[1]: Leaving directory `/home/u/wing/steve/picturel/SE0/vidfor/sys'
make -C /home/u/wing/steve/picturel/SE0/linux-2.6.33-quatro M=/home/u/wing/steve/picturel/SE0/vidfor/sys modules
make[1]: Entering directory `/home/u/wing/steve/picturel/SE0/linux-2.6.33-quatro'
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/linux.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/ops.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/console.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/sysfs.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/ident_tables.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/../libvidforio/vidforio.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/../libvidforio/init.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/../libvidforio/format.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/../libvidforio/video.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/../libvidforio/capture.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/../libvidforio/isr.o - due to target missing
  CC [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/../libvidforio/version.o - due to target missing
  LD [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/vidfor.o - due to target missing
  Building modules, stage 2.
  MODPOST 1 modules - due to target is PHONY
  CC      /home/u/wing/steve/picturel/SE0/vidfor/sys/vidfor.mod.o - due to target missing
  LD [M]  /home/u/wing/steve/picturel/SE0/vidfor/sys/vidfor.ko - due to: /home/u/wing/steve/picturel/SE0/vidfor/sys/vidfor.o /home/u/wing/steve/picturel/SE0/vidfor/sys/vidfor.mod.o
make[1]: Leaving directory `/home/u/wing/steve/picturel/SE0/linux-2.6.33-quatro'

[-- Attachment #3: Makefile --]
[-- Type: application/octet-stream, Size: 941 bytes --]



DRVOBJ := linux.o ops.o console.o sysfs.o ident_tables.o
LIBOBJ := vidforio.o init.o format.o video.o capture.o isr.o version.o

ifneq ($(KERNELRELEASE),)

EXTRA_CFLAGS += -I$(M)/../libvidforio -I$(M)/../../devel/include
obj-m += vidfor.o
vidfor-objs := $(DRVOBJ) $(patsubst %,../libvidforio/%,$(LIBOBJ))

else

KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

version ident_tables.c:
	@echo ' /* MACHINE GENERATED -- DO NOT EDIT */' > tmp.c
	@echo 'const char vidfor_build_stamp[] =' >> tmp.c
	@echo '"'`git describe --tags --long --always --match sys-\*`'";' >> tmp.c
	@diff tmp.c ident_tables.c > /dev/null 2>&1 || (echo "updating ident_tables.c"; cp tmp.c ident_tables.c)
	@rm -f tmp.c

modules:
	$(MAKE) -C ../libvidforio version
	$(MAKE) version
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

modules_install:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

endif

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

* Re: MODULE_LICENSE("GPL") not working for me
  2011-10-08  0:36     ` Stephen Williams
@ 2011-10-09  8:17       ` Sam Ravnborg
  0 siblings, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2011-10-09  8:17 UTC (permalink / raw)
  To: Stephen Williams; +Cc: linux-kernel

On Fri, Oct 07, 2011 at 05:36:22PM -0700, Stephen Williams wrote:
> I've attached the Makefile as I have it so far, and I've also attached the
> output from make ... V=2. The Makefile is a canonical multi-object-file
> module makefile, with some extra trappings for version stamping
> and my source code management.
> 
> When I look at the object files, NONE of the generated *.o files contains
> a .modinfo section, even though there are MODULE_LICENSE("GPL");
> lines in the linux.c source file.
> 
> Incidentally, the source files in the ../libvidforio directory are generic,
> so do not include any kernel header files.

Looks like you do not have CONFIG_MODULE defined in you kernel config.
When using external modules there is today no consistency check that
CONFIG_MODULE is set when building a module.

	Sam

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

end of thread, other threads:[~2011-10-09  8:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 22:02 MODULE_LICENSE("GPL") not working for me Stephen Williams
  -- strict thread matches above, loose matches on Subject: below --
2011-10-06 22:30 Stephen Williams
2011-10-07  9:52 ` Arnd Bergmann
2011-10-07 17:20 ` Stephen Williams
2011-10-07 18:18   ` Sam Ravnborg
2011-10-08  0:36     ` Stephen Williams
2011-10-09  8:17       ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox