Getting "taints kernel" message even after having "Dual BSD/GPL" license
I have just started delving into the world of linux device drivers.
I am trying out the "scull" example from ldd3.
Apparently I am getting the message "scull: module license 'unspecified' taints kernel" even after I have "MODULE_LICENSE("Dual BSD/GPL");" in the code.
This is what I had to change in the original code to get it to run.
1) Replaced all occurrences of CFLAGS in the scull Makefile to EXTRA_CFLAGS due to following error
scripts/Makefile.build:46: *** CFLAGS was changed in "/home/nikhil/Documents/Books/ldd3_pdf/examples/scull/Makefile". Fix it to use EXTRA_CFLAGS. Stop.
2) The code included config.h header file which I believe is no longer included in 2.6 kernel, so just touched one.
3) Got an error wherein it couldn't dereference the "current" pointer.
So included linux/sched.h in access.c
After that everything compiled, but I am unable to load the module as I'm getting following error
"scull: Unknown symbol __wake_up_sync"
Somewhere I read that I can get this error if I don't have the GPL license.
But I do have it.
Somebody else who had faced similar problem reported that he had to fix his makefile (but didn't mention what fix).
I looked at the Makefile and can't find anything.
One more thing I wanted to know, the taints kernel message is logged only the first time. Is that how it works? Only the first occurrence is logged?
AM using custom compiled kernel 126.96.36.199.
# Comment/uncomment the following line to disable/enable debugging
#DEBUG = y
# Add your debugging flag (or not) to EXTRA_CFLAGS
DEBFLAGS = -O -g -DSCULL_DEBUG # "-O" is needed to expand inlines
DEBFLAGS = -O2
EXTRA_CFLAGS += $(DEBFLAGS)
EXTRA_CFLAGS += -I$(LDDINC)
# call from kernel build system
scull-objs := main.o pipe.o access.o
obj-m := scull.o
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
$(MAKE) -C $(KERNELDIR) M=$(PWD) LDDINC=$(PWD)/../include modules
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
depend .depend dep:
$(CC) $(EXTRA_CFLAGS) -M *.c > .depend
ifeq (.depend,$(wildcard .depend))
-Thanks in advance
I think you have a better chance of resolving the issue if you ask on kernel related mailing lists.
I noticed a similar issue when mucking around with the Intel 536ep kmod. Basically, unless the kernel agrees that it is not "tainted", it refuses to export needed programming objects/symbols. What a way to discourage 3rd party programmers from releasing driver code for their hardware!
Note that if the code for your module is in multiple files that need to be linked, you need to tell the build system which files to compile. In the case of multiple files, none of these files can be named hello.c because doing so would cause a problem with the linking step. Assuming your code exists in file1.c, file2.c, and file3.c and you want to build hello.ko from them, your Makefile should include:
obj-m := hello.o
hello-objs := file1.o file2.o file3.o
|All times are GMT -5. The time now is 08:04 PM.|