I am looking into cross compiling a kernel module for an ARM linux.
The kernel version on my host is 3.13.0-24generic while on the target it's 3.10.17-r0
Now what kernel sources or headers do I actually need to download and install, and where? I downloaded linux-3.10.17tar.bz2 from kernel.org and extracted it. In drivers there's a Makefile and according to this site I need to append these lines to it, then run make:
ARCH=arm
CROSS_COMPILE=arm-poky-linux-gnueabi-gcc
KDIR := /lib/modules/'uname -r'/build
obj-m +=test5.o
all :
make -C ${KDIR}/build M=$(PWD) modules
clean :
make -C ${KDIR}/build M=$(PWD) clean
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.