All of lore.kernel.org
 help / color / mirror / Atom feed
* Out-of-tree Kernel Modules
@ 2024-10-30 12:58 Yishai Jaffe
  2024-10-30 13:25 ` [yocto] " Quentin Schulz
  0 siblings, 1 reply; 6+ messages in thread
From: Yishai Jaffe @ 2024-10-30 12:58 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1583 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2032 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-10-31  7:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30 12:58 Out-of-tree Kernel Modules Yishai Jaffe
2024-10-30 13:25 ` [yocto] " Quentin Schulz
2024-10-30 14:54   ` Yishai Jaffe
2024-10-30 15:01     ` Quentin Schulz
2024-10-30 19:01       ` Yishai Jaffe
2024-10-31  7:33         ` Yoann Congal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.