How to add my modules into android kernel from outside of kernel src tree?

166 views
Skip to first unread message

chungae9ri

unread,
Feb 9, 2010, 2:17:48 AM2/9/10
to android-porting
Hi all
I put my module src files of helloworld into vendor/xxx/modules and I
want to add my driver modules into android but I can't build it.
this is my Makefile, it's simple

obj-m += Hello.o
modules:
<tab> $(MAKE) -C $(KERNELDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$
(CROSS_COMPILE) modules


when I "make modules" the following error occurs

ERROR : kernel configuration is invalid.
include/linux/autoconf.h or include/config/auto.conf
are missing.
Run 'make oldconfig && make prepare' on kernel src to
fix it.

CC [M] /media/slave2/work/xxx/LINUX/android/vendor/xxx/modules/
Hello.o
cc1: error: include/linux/autoconf.h: No such file or directory
In file included from include/linux/prefetch.h:14,
from include/linux/list.h:6,
from include/linux/module.h:9,
from /media/slave2/work/xxx/LINUX/android/vendor/xxx/
modules/Hello.c:1:
/media/slave2/work/xxx/LINUX/android/kernel/arch/arm/include/asm/
processor.h:109:5: error: "__LINUX_ARM_ARCH__" is not defined
In file included from /media/slave2/work/xxx/LINUX/android/kernel/arch/
arm/include/asm/system.h:6,
from include/linux/list.h:7,
from include/linux/module.h:9,
from /media/slave2/work/xxx/LINUX/android/vendor/xxx/
modules/Hello.c:1:
/media/slave2/work/xxx/LINUX/android/kernel/arch/arm/include/asm/
memory.h:18:25: error: mach/memory.h: No such file or directory
In file included from /media/slave2/work/xxx/LINUX/android/kernel/arch/
arm/include/asm/system.h:6,
from include/linux/list.h:7,

How can I fix this?

chungae9ri

unread,
Feb 9, 2010, 2:17:48 AM2/9/10
to android-porting

victory rocks

unread,
Feb 18, 2010, 5:22:33 AM2/18/10
to chung...@gmail.com, android-porting
The following will solve the problem:
obj-m += Hello.o
all:
    $(MAKE) -C $(KERNELDIR) M=$(PWD)  modules
install:
 
 


 

victory rocks

unread,
Feb 18, 2010, 5:30:57 AM2/18/10
to chung...@gmail.com, android-porting
Sorry for my previous wrong and incompleter posts.....
The following will solve the problem:
obj-m += Hello.o
all:
  @ $(MAKE) -C $(KERNELDIR) M=$(PWD)  modules
install:
   @$(MAKE) -C $(KERNELDIR) M=$(PWD)  modules_install
 clean:
    rm -f *.o *.ko *.mod.c *.mod.c *.mod.o .*.cmd *~ modules.order Module.symvers
 
 
The above is the Makefile and in your module source directory give the following command:
$ make KERNELDIR=/path/linux/kernel/sources/


On 9 February 2010 16:17, chungae9ri <chung...@gmail.com> wrote:

pavan savoy

unread,
Feb 18, 2010, 5:33:17 AM2/18/10
to eurekh...@gmail.com, chung...@gmail.com, android-porting
make modules_prepare steps hasn't been done... and hence those errors...
But I still don't understand how you would be able to build modules
from android.mk file.

--
--Pavan Savoy

Reply all
Reply to author
Forward
0 new messages