I am looking into cross compiling a kernel module for an ARM linux. I have my toolchain installed.
But there's something I am not quite getting from various how-tos.
The module I want to build is gadgetfs
.
The kernel version on my host is 3.5.0-34-generic
while
on the target it's 3.6.9-0.1
Now what kernel sources or headers do I actually need to download and install, and where?
I downloaded linux-3.6.9.tar.bz2
from kernel.org
and extracted it.
In drivers/usb/gadget/
there's a Makefile
and according to this site I need to append these lines to it, then run make
:
KDIR := /lib/modules/`uname -r`/build
PWD := `pwd`
obj-m := dummy_hcd.o gadgetfs.o
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
But what do i have to replace uname -r
with? Cause this would give me my host's kernel version. But my target version is different. Where is the /lib/modules/3.6.9
folder?
CROSS_COMPILE
and ARCH
is both set.