On 28.12.2020 15:40, p32 via lists.yoctoproject.org wrote:

Hello everyone,

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:
 - packagegroup-core-buildessential
 - kernel-modules
 - kernel-dev
 - kernel-devsrc

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,
                 from ./include/linux/list.h:5,
                 from ./include/linux/module.h:9,
                 from /root/hello.c:1:
./include/uapi/linux/types.h:5:10: fatal error: asm/types.h: No such file or directory
    [...]
compilation terminated.

Hi,


You need to run "make scripts prepare" in /usr/src/kernel before trying to compile kernel modules on target.


Ovidiu

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:
https://source.codeaurora.org/external/imx/imx-manifest/tree/imx-5.4.47-2.2.0.xml?h=imx-linux-zeus

Thanks!



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#51841): https://lists.yoctoproject.org/g/yocto/message/51841
Mute This Topic: https://lists.yoctoproject.org/mt/79268891/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to