Hi, I'm having a problem compiling my out of tree kernel module. I've managed to reproduce my problem with the meta-skeleton hello-mod recipe. I'm working with poky on branch scarthgap. Here are the necessary changes:
diff --git a/meta-skeleton/recipes-kernel/hello-mod/files/hello.c b/meta-skeleton/recipes-kernel/hello-mod/files/hello.c index 4f73455d20..221b5da97c 100644 --- a/meta-skeleton/recipes-kernel/hello-mod/files/hello.c +++ b/meta-skeleton/recipes-kernel/hello-mod/files/hello.c @@ -7,9 +7,13 @@ *****************************************************************************/ #include <linux/module.h> +#include <linux/sched/types.h> static int __init hello_init(void) { + struct sched_param a = { + .sched_priority = 1, + }; pr_info("Hello World!\n"); return 0; } As you can see I'm trying to use the sched_param struct but when compiling I get the following error: | /home/user/dev/yishai/yocto/build/tmp/work/qemux86_64-poky-linux/hello-mod/0.1/hello.c: In function 'hello_init': | /home/user/dev/yishai/yocto/build/tmp/work/qemux86_64-poky-linux/hello-mod/0.1/hello.c:14:16: error: variable 'a' has initializer but incomplete type | 14 | struct sched_param a = { This looks as if the struct isn't defined anywhere but if I look at tmp/work/qemux86_64-poky-linux/hello-mod/0.1/recipe-sysroot/usr/include/linux/sched/types.h which should be the header that I included - I can see that it is defined. Therefore, it seems like that is not the actual header being included. Would love to get some help on this! Thanks in advance, Yishai Jaffe
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#64181): https://lists.yoctoproject.org/g/yocto/message/64181 Mute This Topic: https://lists.yoctoproject.org/mt/109295266/21656 Group Owner: yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-