I have been loading kernel modules manually with modprobe using the sysvinit system. Today, I was pointed out that there are better options like "module autoload". Having had a bit of Google search on my end, I came to realize there is some support in openembedded for this already, as follows: https://www.mail-archive.com/yocto@yoctoproject.org/msg11938.html It would be really useful to document these hidden gems. I would be particularly interested in the following two features: module_autoload_<modname> = "modname1 modname2 modname3" module_conf_<module-package> = "args" The syntax would be "man modprobe.d" for the latter. There might be other features in there that I have not yet revealed, but these are already useful and if only I had come across these a few months ago when first reading the Yocto kernel development manual.
Following up on our discussion on irc: module_autoload_<modname> = "modname1 modname2 modname3" The first one populates /etc/modules-load.d/modname.conf file with the list of modules need to be autoloaded on boot - modname1, modname2, modname3 (one per line in the file). The most common use case is: module_autoload_modname = "modname" ================================= module_conf_<modname> = "modprobe.d-syntax" The second one populates /etc/modprobe.d/modname.conf file with the modprobe.d syntax lines, which you can check by running "man modprobe.d". A most common one is to pass module parameters with something like: module_conf_<modname> = "options modname arg1=val1 arg2=val2" ================================= All this is coming from kernel-module-split.bbclass, but would definitely be nice to have it documented better.
Having looked over the comments, the links, the reference archived email thread and the kernel-module-split.bbclass file, I think we need to do a couple things: 1) Expand on the kernel-module-split section in the class reference section (http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#ref-classes-kernel-module-split). Right now it is minimal. I could use some help understanding what we would want to further describe from this class. Denys in Comment 1 provided some brief explanations for module_autoload_<modname> and module_conf_<modname>. I looked through that class and don't really get it since I am not a developer. Maybe someone could identify and explain the relevant parts of that class suitable for the entry in the reference manual. 2) From what I gathered through the archived email thread that Laszlo referenced (https://www.mail-archive.com/yocto@yoctoproject.org/msg11938.html), the way to cause YP to load specific modules is to define xxx in a machine conf file and a machine include file. I am not sure if both are needed or one. The examples I saw were buried in the mail thread (http://cgit.openembedded.org/meta-handheld/tree/conf/machine/palmtx.conf and http://cgit.openembedded.org/meta-handheld/tree/conf/machine/include/palm.inc). So it follows that perhaps we want a section in the development manual dedicated on how to load modules... split or otherwise. I need some input on this. I am adding both Paul and Richard to the CC list for the bug. Scott
Scott, It doesn't matter where you define module_autoload and/or module_conf - the 2 examples in meta-handheld you gave use machine config/include file. Some people put those lines in their distro config. We also used it in a bbappend file for an out-of-tree kernel module recipe (http://arago-project.org/git/?p=meta-arago.git;a=blob;f=meta-arago-distro/recipes-kernel/cryptodev/cryptodev_1.6.bbappend;hb=HEAD)
Denys, Thanks for that clarification. If anyone can help with the other questions I have in there that would be good. Scott
Scott, as for the other question, I would say, you do not need to look much into that class. You could take more or less what Denys wrote and integrate. That information would have been enough for me to get going when faced the issue. Thank you for your work.
Hi, Thanks for the further information Laszlo. Here is the first attempt at documenting these two variables. Paul indicated that we could just include them in the variable glossary. http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-module_autoload http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-module_conf Please review the content and let me know if I need to make updates. Thanks, Scott
Looks good to me, thanks.
Thanks for the quick review Laszlo. I will wait a day or two to see if Denys or Paul chimes in with some review comments before closing this one out. Scott
There's a slight caveat for "use this anywhere" - it's anywhere it can be picked up by the recipe building the kernel or out-of-tree module; e.g. setting it in an image recipe wouldn't work.
Thanks Paul, Here are the new versions: http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-module_autoload http://www.yoctoproject.org/docs/1.6/ref-manual/ref-manual.html#var-module_conf Scott
Scott, Looks good. Sorry for the confusion with "everything" statement... :)
Denys, No problems. I am marking this bug's documentation flag as "Done" and the bug to RESOLVED. Thanks for all the help Denys, Laszlo, and Paul. Scott