How to develop kernel modules on the target?
I am using the Yocto-based build system provided by NXP (primarily via the meta-freescale layer) to create Linux images for an i.MX 8M board and would like to develop small kernel modules without going through the build process of the entire image after each modification. Therefore, I would prefer to compile the kernel modules on the target architecture and have added the following items to the IMAGE_INSTALL variable via my local.conf:
I then tried to follow the the official build instructions (https://www.kernel.org/doc/html/latest/kbuild/modules.html) on the target but was unable to create a kernel module:
imx8mqevk:~# make -C /lib/modules/$(uname -r)/build M=$PWD
make: Entering directory '/lib/modules/5.4.47-2.2.0+g5ec03d06f54e/build'
CC [M] /root/hello.o
In file included from ./include/linux/types.h:6,
./include/uapi/linux/types.h:5:10: fatal error: asm/types.h: No such file or directory
What am I missing here? Is there something else I have to do on the target before I can compile kernel modules on the target?
For the sake of completeness: The build is based on the Zeus release and the following repo manifest file: