[oe] Problems building a kernelmodule for OE

Henk Geraads linux at hf-electronics.com
Mon Oct 27 08:13:04 UTC 2008


Hi,

I am not sure if i posted it in the correct mailing list!
But I am trying to make a kernel module for the OE distro angstrom 2007-12 for machine CM-X270.

when I try to make the module, following error message is produced!

	In file included from include/linux/jiffies.h:4,
     	      	     from include/linux/sched.h:54,
      	           from include/asm/uaccess.h:14,
                 	     from /home/henk/cm270/fifodrv/cfi-ktst/cfi-mod.c:10:
	include/linux/calc64.h: In function 'do_div_llr':
	include/linux/calc64.h:25: error: '__LINUX_ARM_ARCH__' undeclared (first use in this function)
	include/linux/calc64.h:25: error: (Each undeclared identifier is reported only once
	include/linux/calc64.h:25: error: for each function it appears in.)
	/home/henk/cm270/fifodrv../cfi-ktst/cfi-mod.c: In function 'cfi_ioctl':
	/home/henk/cm270/fifodrv/cfi-ktst/cfi-mod.c:67: warning: implicit declaration of function 'GPLR'
	/home/henk/cm270/fifodrv/cfi-ktst/cfi-mod.c:67: warning: implicit declaration of function 'GPIO_bit'
	/home/henk/cm270/fifodrv/cfi-ktst/cfi-mod.c: In function 'cfi_init':
	/home/henk/cm270/fifodrv/cfi-ktst/cfi-mod.c:204: error: 'GPIO_IN' undeclared (first use in this function)
	/home/henk/cm270/fifodrv/cfi-ktst/cfi-mod.c:208: error: 'MSC1' undeclared (first use in this function)
	/home/henk/cm270/fifodrv/cfi-ktst/cfi-mod.c:209: error: 'GPIO79_nCS_3_MD' undeclared (first use in this function)
	make[2]: *** [/home/henk/cm270/fifodrv/cfi-ktst/cfi-mod.o] Error 1
	make[1]: *** [_module_/home/henk/cm270/fifodrv/cfi-ktst] Error 2
	make: *** [default] Error 2

My source for the module cfi-kernel is located in the
path: /home/henk/cm270/fifodrv

I create with "bitbake linux -c defshell -f" an enviroment with the
"correct" path's and env.var's.

Makefile:
	# Makefile for external CFI kernel module
	CFLAGS = -march=armv5t -Wall -D_GNU_SOURCE 

	ifneq ($(KERNELRELEASE),)
	# we are inside the kernel tree and called from kernel build system

	obj-m   := cfi-mod.o
	else
	# we are a separate module and start the kernel make and give it our directory
	KERNELDIR = /home/henk/oe/build/tmp/angstrom/work/cm-x270-angstrom-linux-gnueabi/linux-2.6.23-r8/linux-2.6.23

	#KERNELDIR = ../linux-26
	PWD       := $(shell pwd)

	default:
		$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
	endif

	clean::
		$(RM) -rf *.o .depend .*.cmd *.ko *.mod.c .tmp_versions *~

	.PHONY: clean

	depend .depend dep:
		$(CC) $(CFLAGS) -M *.c > .depend

	ifeq (.depend,$(wildcard .depend))
	include .depend
	endif


start op the module sourcecode:

	#include <linux/module.h>
	#include <linux/kernel.h>
	#include <linux/ioport.h>
	#include <linux/fs.h>
	#include <asm/uaccess.h>
	#include <asm/io.h>

	MODULE_AUTHOR("Henk");  
	......


What is my mistake??

Thanks in advance for any reaction!

Henk






More information about the Openembedded-devel mailing list