April 9, 2010

kernel module: no symbol version for struct_module

Hi all,

I try to build a simple kernel module on Ubuntu 9.04 with an self compiled (make-kpkg) 2.6.29.4 Kernel. The kernel module is a simple "Hello World" example listed below:

#include <linux/module.h>
#include <linux/kernel.h>

int init_module(void)
{
printk(KERN_INFO "Hello world 1.\n");

return 0;
}

void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world 1.\n");
}

The Makefile which belongs to the module looks like:

MODULENAME := anytimeKM

obj-m += $(MODULENAME).o

prefix := $(shell rtai-config --prefix)

ifeq ($(prefix),)
$(error Please add <rtai-install>/bin to your PATH variable)
endif

CC = $(shell rtai-config --cc)

LINUX_DIR = $(shell rtai-config --linux-dir)

all:$(MODULENAME).ko

$(MODULENAME).ko:$(MODULENAME).c
$(MAKE) -C $(LINUX_DIR) CC=$(CC) SUBDIRS=$$PWD V=$(V) modules

clean::
$(RM) $(LINUX_DIR)/.tmp_versions/*_rt.mod *.o *.ko *.mod.c .*.cm

.PHONY: clean

The compile process works fine except of the following warning message:

....
Warning: Symbol version dump /usr/linux-2.6.29.4/Module.symvers is missing; modules will have dependencies and modversions.
....

When I try to insmod the module I get the following error message:

insmod: error inserting 'anytimeKM.ko': -1 Invalid module format

dmesg prints:

anytimeKM: no symbol version for struct_module

Does anybody knows how to fix that problem? I will appreciate it if somebody can bring some light to the dark.

Best regards

Nekoto