kernel-module-split.bbclass: Allow autoloading multiple modules or modules where...
authorMartin Jansa <martin.jansa@gmail.com>
Mon, 21 Jul 2014 21:40:47 +0000 (23:40 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 Jul 2014 20:59:15 +0000 (21:59 +0100)
* new KERNEL_MODULE_AUTOLOAD syntax doesn't support modules where basename and
  module name don't match (usually - and _), e.g.:

  module_autoload_bq27x00_battery = "bq27x00-battery"

* sometimes it's useful to load modules in particular order and
  module_autoload allowed to just list multiple modules, e.g.:

  module_autoload_snd-soc-neo1973-wm8753 = "snd-soc-s3c24xx snd_soc_s3c24xx_i2s snd-soc-dfbmcs320 snd-soc-wm8753 snd-soc-neo1973-wm8753"
  or
  module_autoload_g_ether = "s3c2410_udc g_ether"

  restore this possibility which is useful for incorrect dependencies
  between modules

(From OE-Core rev: e9cd8ba3dda624615b68c601eac04427d9483f14)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel-module-split.bbclass

index 0c045c9..9a95b72 100644 (file)
@@ -132,12 +132,18 @@ python split_kernel_module_packages () {
         # appropriate modprobe commands to the postinst
         autoloadlist = (d.getVar("KERNEL_MODULE_AUTOLOAD", True) or "").split()
         autoload = d.getVar('module_autoload_%s' % basename, True)
-        if autoload:
-            bb.error("KERNEL_MODULE_AUTOLOAD has replaced module_autoload_%s, please replace it!" % basename)
+        if autoload and autoload == basename:
+            bb.warn("module_autoload_%s was replaced by KERNEL_MODULE_AUTOLOAD for cases where basename == module name, please drop it" % basename)
+        if autoload and basename not in autoloadlist:
+            bb.warn("module_autoload_%s is defined but '%s' isn't included in KERNEL_MODULE_AUTOLOAD, please add it there" % (basename, basename))
         if basename in autoloadlist:
             name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename)
             f = open(name, 'w')
-            f.write('%s\n' % basename)
+            if autoload:
+                for m in autoload.split():
+                    f.write('%s\n' % m)
+            else:
+                f.write('%s\n' % basename)
             f.close()
             postinst = d.getVar('pkg_postinst_%s' % pkg, True)
             if not postinst: