All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [hardknott] module.bbclass: Improve kernel module dependency detection
@ 2021-09-11 20:28 Charlie Davies
  2021-09-11 21:11 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Charlie Davies @ 2021-09-11 20:28 UTC (permalink / raw)
  To: openembedded-core; +Cc: Charlie Davies

If a kernel module recipe specifies a DEPENDS on another
kernel module currently the module being depended on
must have a name starting with kernel-module- .

It is perfectly valid to name a package without the
kernel-module- scheme and instead use:

RPROVIDES_${PN} += "kernel-module-my-module"

in the package's recipe to provide an alias package
name.

This commit introduces functionality which will search
through the RPROVIDES aliases of each dependency package
to allow packages not named kernel-module- to be
recognised as dependencies.

Signed-off-by: Charlie Davies <charles.davies@whitetree.xyz>
---
 meta/classes/module.bbclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
index a09ec3ed1e..c4f052234d 100644
--- a/meta/classes/module.bbclass
+++ b/meta/classes/module.bbclass
@@ -6,11 +6,25 @@ MODULES_INSTALL_TARGET ?= "modules_install"
 MODULES_MODULE_SYMVERS_LOCATION ?= ""
 
 python __anonymous () {
+    import oe.packagedata
+
     depends = d.getVar('DEPENDS')
     extra_symbols = []
     for dep in depends.split():
         if dep.startswith("kernel-module-"):
             extra_symbols.append("${STAGING_INCDIR}/" + dep + "/Module.symvers")
+        else:
+            if oe.packagedata.has_subpkgdata(dep, d):
+                data = oe.packagedata.read_subpkgdata(dep, d)
+                key = "RPROVIDES_%s" % dep
+                rprovs = data.get(key)
+
+                if rprovs is not None:
+                    for rprov in rprovs.split():
+                        if rprov.startswith("kernel-module-"):
+                            extra_symbols.append("${STAGING_INCDIR}/" + dep + "/Module.symvers")
+                            break
+
     d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols))
 }
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-11 22:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-11 20:28 [PATCH] [hardknott] module.bbclass: Improve kernel module dependency detection Charlie Davies
2021-09-11 21:11 ` [OE-core] " Richard Purdie
2021-09-11 22:30   ` Charlie Davies

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.