Reputation: 43
I try to add a kernel module to a yocto image and load it on boot.
I create a recipe to build and install a kernel module. Here's a part of the Makefile content:
modules_install: test_driver.ko
install -d $(MODULES_DIR)
install -m 0755 $< $(MODULES_DIR)
In my build/conf/local.conf, I add the package (subsystem being the name of my module recipe):
IMAGE_INSTALL_append = " subsystem"
After building the image, I can find the .ko file inside the MODULES_DIR directory (being /lib/modules/(shell uname -r)/kernel/drivers/test
).
I want to do now is to load this module on boot. I found some clues about KERNEL_MODULE_AUTOLOAD
and MACHINE_ESSENTIAL_*/MACHINE_EXTRA_*
.
So I try KERNEL_MODULE_AUTOLOAD += "subsystem"
or even KERNEL_MODULE_AUTOLOAD += "test_driver"
in build/conf/local.conf
or in my module recipe, but I couldn't have the driver loaded on boot.
I'm working against the fsl-image-machine-test image (sumo version).
Upvotes: 1
Views: 2190
Reputation: 43
The KERNEL_MODULE_AUTOLOAD need to be outside of the local.conf file. I put it now in my module recipe.
It needs to load the name of the module not the recipe, in my case :
KERNEL_MODULE_AUTOLOAD += "test_driver"
.
Upvotes: 0