Adding External Kernel Modules to Yocto

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding External Kernel Modules to Yocto

2,484 Views
oguzhandalgic
Contributor I

Hello,

I would like to add an external device driver as kernel module. Before that, I wanted to try the example hello-mod shipped with poky, however I get an error related to linux headers.

The example I am trying to bitbake is available in the following path:

sources/poky/meta-skeleton/recipes-kernel/hello-mod/

I created a layer named "meta-fsl-test" using poky's yocto-layer script and copied the hello-mod folder into the created layer folder. 

bitbake hello-mod

above command returns below error,

| DEBUG: Executing shell function do_compile
| helloworld.c:1:26: fatal error: linux/module.h: No such file or directory
| compilation terminated.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile

Can anyone tell me to which places does the do_compile function looks for the headers? How can I solve this problem? 

Thanks in advance,

Bests.

Labels (3)
0 Kudos
1 Reply

1,069 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Oguzhan Dalgic,

I would recommend checking the recipe you copied. The recipe I found for the hello-mod example as part of the meta-skeleton branch of poky inherited the module class.

Inside the module class definition, you should see he variables that is taking including the KERNEL_PATH variable.

I hope this helps!

Regards,

0 Kudos