2009-07-02 08:11:27 Building external (out of tree) module into kernel
Dave Henning (UNITED STATES)
Message: 76684
I am developing an external or "out of tree" kernel module. My basic build is working. However, when I try to install it into the kernel, it can't find any symbols at all.
I tried to follow the directions here:
http://docs.blackfin.uclinux.org/doku.php?id=building_modules
Following that, I came up with the attached Makefile, with the following important code section
ifneq ($(KERNELRELEASE),)
.
.
.
obj-$(CONFIG_SMS_SIANO_MDTV) := smsmdtv.o
else
IDIR := ~/blackfin-sources/uclinux-dist/romfs
KDIR := ~/blackfin-sources/uclinux-dist/linux-2.6.x
PWD := $(shell pwd)
default:
@echo "calling non-kernel make"
make -C $(KDIR) SUBDIRS=$(PWD) modules
install:
cp -v smsmdtv.ko ~
$(MAKE) -C $(KDIR) INSTALL_MOD_PATH=$(IDIR) \
SUBDIRS=$(PWD) modules_install
clean:
rm -f *.ko *.o *~ 2>/dev/null
endif
Yet when, I do this, I get an error message for every kernel call I make similar to the ones I have shown below:
WARNING: /home/dave/blackfin-sources/uclinux-dist/romfs/lib/modules/2.6.28.10-ADI-2009R1-
pre-svn6380/extra/smsmdtv.ko needs unknown symbol _param_get_short
WARNING: /home/dave/blackfin-sources/uclinux-dist/romfs/lib/modules/2.6.28.10-ADI-2009R1-
pre-svn6380/extra/smsmdtv.ko needs unknown symbol _release_firmware
WARNING: /home/dave/blackfin-sources/uclinux-dist/romfs/lib/modules/2.6.28.10-ADI-2009R1-
pre-svn6380/extra/smsmdtv.ko needs unknown symbol _param_array_set
WARNING: /home/dave/blackfin-sources/uclinux-dist/romfs/lib/modules/2.6.28.10-ADI-2009R1-
pre-svn6380/extra/smsmdtv.ko needs unknown symbol _input_register_device
What am I missing? What should my $(IDIR) variable be set to if I want to add it to my uclinux build?
Thanks,
Dave
Makefile
QuoteReplyEditDelete
2009-07-02 10:50:38 Re: Building external (out of tree) module into kernel
Mike Frysinger (UNITED STATES)
Message: 76691
when does it warn ? during build or install ?
are you building this in the uclinux-dist tree or outside of it ?
QuoteReplyEditDelete
2009-07-02 14:08:33 Re: Building external (out of tree) module into kernel
Dave Henning (UNITED STATES)
Message: 76699
It fails during 'make install'. The 'make' works fine.
I am building out of tree.
What I want to be able to do is the following:
1. Develop out-of-tree until I get a copy I want to keep for a while.
2. Run 'make install' from my driver tree to install the .ko file into the uclinux-dist tree.
3. Build uImage with new driver by running 'make' from .../uclinux-dist.
This seems like a fairly normal development procedure, but I can't quite figure out what I'm missing.
Thanks for your help,
Dave ...
QuoteReplyEditDelete
2009-07-02 22:22:15 Re: Building external (out of tree) module into kernel
Mike Frysinger (UNITED STATES)
Message: 76717
this is because the default make uses the hosts' depmod which knows nothing of symbol prefixes
simply add DEPMOD=true to the install line
QuoteReplyEditDelete
2009-07-05 21:48:23 Re: Building external (out of tree) module into kernel
Dave Henning (UNITED STATES)
Message: 76814
I tried your suggestion and the warnings went away. Thanks so much, Mike.
QuoteReplyEditDelete