How to build a package that has spidev module installed?


I am working with SPI bus on FX30 (WP8548).
I would like to build a package that has spidev installed (i.e. I don’t need to install it in user space by using modprobe). How should I do this?


I think you can edit /etc/modules and append “spidev” and then the module will be loaded at startup. I’m not sure if the fx30 for the wp85 has anything that creates the spidev device. For the standard wp85 release, there is a kernel module in the legato source called spisvc that creates the spidev device. You can build and load that automatically by updating your system definition (SDEF) to include spisvc in the kernelModules section.


Thanks for reply.

To add the spidev to /etc/module works.
Is it the proper way to enable the kernel module instead of attempting to modify and rebuild from yocto?

I also add the spisvc module to system.sdef with following,


spisvc will be loaded after I restart legato.

If you’re trying to do this at scale, then hand editing the /etc/modules file is not ideal. It should be possible to modify the yocto build to create a linux image that already has spidev in the /etc/module file.

For people who is also interested in including the spidev to the image, here is the way:
Add KERNEL_MODULE_AUTOLOAD += "spidev " into the recipes that can be recognized by kernel recipes or out-of-tree kernal recipes ex.