Skip to contentSkip to conversation

linux-mfgtool.inc: Fix Taskhash mismatch due kernel version re-evaluation

PATCH New Otavio Salvador 1 participant 1 message Oct 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-mfgtool.inc: Fix Taskhash mismatch due kernel version re-evaluation

KERNEL_VERSION is extracted from source code. It is evaluated as None for the first parsing, since the code has not been fetched.

After the code is fetched, it will be evaluated as real version number and cause kernel to be rebuilt. To avoid this, make KERNEL_VERSION_NAME and KERNEL_VERSION_PKG_NAME depend on LINUX_VERSION which is a constant.

Fixes following error:

,----

| ERROR: Bitbake's cached basehash does not match the one we just
|   generated (.../linux-imx-mfgtool_4.1.15.bb.do_package)!
| ERROR: The mismatched hashes were 9ee4645e51989f32cb456a6a920b08c5 and 6b5111eabd2b77ab1266a02f71200f86
| ERROR: Taskhash mismatch b64a99840810703ae6c0cf2b53de3ff6 versus b3587f37767f2d28aa2f3fd1f4548e85
|   for .../linux-imx-mfgtool_4.1.15.bb.do_package

`----

---

 recipes-kernel/linux/linux-mfgtool.inc | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
recipes-kernel/linux/linux-mfgtool.inc +14 -1
index 8701aff..945096a 100644
@@ -6,7 +6,7 @@
 # This file must be included after the original linux-imx.inc file
 # as it overrides the needed values.
 #
-# Copyright (C) 2014, 2015 O.S. Systems Software LTDA.
+# Copyright (C) 2014-2016 O.S. Systems Software LTDA.
 
 # Adjust provides
 PROVIDES = "linux-mfgtool"
@@ -18,10 +18,22 @@ KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-mfgtool-${PKGE}-${PKGV}-${PKGR}-${
 KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
 KERNEL_IMAGE_SYMLINK_NAME = "${KERNEL_IMAGETYPE}-mfgtool-${MACHINE}"
 MODULE_IMAGE_BASE_NAME = "modules-mfgtool-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
 MODULE_TARBALL_SYMLINK_NAME = "modules-mfgtool-${MACHINE}.tgz"
 STAGING_KERNEL_DIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-mfgtool-source"
 STAGING_KERNEL_BUILDDIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-mfgtool-build-artifacts"
 
+# KERNEL_VERSION is extracted from source code. It is evaluated as
+# None for the first parsing, since the code has not been fetched.
+# After the code is fetched, it will be evaluated as real version
+# number and cause kernel to be rebuilt. To avoid this, make
+# KERNEL_VERSION_NAME and KERNEL_VERSION_PKG_NAME depend on
+# LINUX_VERSION which is a constant.
+KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION', True) or ""}"
+KERNEL_VERSION_NAME[vardepvalue] = "${LINUX_VERSION}"
+KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION', True))}"
+KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}"
+
 # Ensures we prefer our mfgtool specific files
 FILESEXTRAPATHS_prepend := "${THISDIR}/${ORIG_PN}-${PV}:${THISDIR}/${ORIG_PN}:"
 
@@ -62,6 +74,7 @@ python () {
     clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
 
     clsextend.map_packagevars()
+    clsextend.map_variable("PROVIDES")
     clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
 }
 
Signature · 1 line
2.10.0