I’m trying to write a LKM for my module. Till thus this far I think I managed to build .ko file with the following makefile:
export ARCH:=arm export CROSS_COMPILE:=~/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- obj-m+=hello.o all: make -C ~/linux-toradex/ M=$(PWD) modules clean: make -C ~/linux-toradex/ M=$(PWD) clean
The LKM is very simple, it just announces that it is loaded and not more (yet). However when I try to load the module I get the error that is an invalid format. I guess this is because the kernel is 4.1.35 and the module is compiled against version 4.1.41.
Because there is a difference, the kernel will not accept the module. I tried several way to compile the module to the correct version or updating the kernel to the same version. However none worked so far. I guess this is just a missing rule somewhere on my side, only I cant find the solution to this.
I’m able to bitbake a new image with openembedded and to make an .dtb with the linux-toradex kernel. I think there are two solutions, only I don’t know how to do this:
- Link the local linux-toradex kernel to the open embedded bitbake process. Thus the kernel source is the same to which I compile my LKM against.
- To make sure that the correct version are “downloaded”.
Can someone point me in the right direction to solve this problem of mine.