[OE-core] [PATCH] packake_ipk.bbclass: add kernel version to module dependencies

Ovidiu Vancea ovidiu.vancea at ni.com
Fri May 27 15:59:46 UTC 2016


Updating the kernel ("opkg install kernel") does not update the
dependencies (i.e. modules) because there is no possibility to do version
enforcement in the OE recipe. Upon rebooting, the older version modules
do not load and can leave hardware in a non-functioning state (if their
drivers are not built into the kernel).

Use the Version field from the kernel package on its rdepends, rrecommends,
and rsuggests fields’ version. This makes the packages on which the kernel
depends to be the same version as the kernel.

Version field contains package build number (including git hash) and package
revision, thus restricting the kernel and modules to always be built together.

Signed-off-by: Ovidiu Vancea <ovidiu.vancea at ni.com>
---
 meta/classes/package_ipk.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index f1ad1d5..8468caf 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -196,6 +196,15 @@ python do_package_ipk () {
         rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
         debian_cmp_remap(rconflicts)
 
+        if (pkgname == "kernel") and (localdata.getVar("VERSION_KERNEL_MODULES", False) == "1"):
+            suffix = "="+localdata.getVar('PKGV', True)+"-"+localdata.getVar('PKGR', True)
+            for key in rdepends:
+                rdepends[key]    = suffix
+            for key in rsuggests:
+                rsuggests[key]   = suffix
+            for key in rrecommends:
+                rrecommends[key] = suffix
+
         if rdepends:
             ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
         if rsuggests:
-- 
2.7.4




More information about the Openembedded-core mailing list