简体   繁体   中英

How can I auto load kernel module on boot in Yocto? (like "insmod /xxx/oo.ko")

Our system is NXP fsl-image-auto and build with Yocto project. Now we have a 3rd party ko "apex.ko", rootfs Path is /s32v/apex.ko

This module need load on linux boot, so we add "insmod /s32v/apex.ko" line into rcS.d to do this job.

Can this function be done with Yocto?

I tried "KERNEL_MODULE_AUTOLOAD += apex" but it seems can't work. And I tried "module_do_install()", but bitbake has "make: *** No targets specified and no makefile found. Stop. ERROR: oe_runmake failed" error massage.

How can I do this? Thanks...

The way we use to add a kernel module at startup is by adding KERNEL_MODULE_AUTOLOAD variable:

KERNEL_MODULE_AUTOLOAD += "mymodule"

But you need to add it in your machine.conf, or in a recipe (not an image), as described in the documentation :

You can use the KERNEL_MODULE_AUTOLOAD variable anywhere that it can be recognized by the kernel recipe or by an out-of-tree kernel module recipe (eg a machine configuration file, a distribution configuration file, an append file for the recipe, or the recipe itself).

[...]

Including KERNEL_MODULE_AUTOLOAD causes the OpenEmbedded build system to populate the /etc/modules-load.d/modname.conf file with the list of modules to be auto-loaded on boot. The modules appear one-per-line in the file.

I think you should add prefix to name of your module:

 KERNEL_MODULE_AUTOLOAD += "module_name"

https://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-KERNEL_MODULE_AUTOLOAD

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM