Welcome to the Linux Foundation Forum!

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

Comments

  • Posts: 501
    With the most recent versions of the kernel, you need to actually configure and build (but not install) the kernel in order to properly build a loadable kernel module. At least that was what I understood when I recently had to do that. So, I have done so, and everything works as expected.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training