Backport fix for image class dependencies 51/11351/2
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>
Mon, 16 Oct 2017 19:34:53 +0000 (21:34 +0200)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Wed, 18 Oct 2017 13:11:35 +0000 (13:11 +0000)
This ports http://lists.openembedded.org/pipermail/openembedded-core/2017-September/142760.html
to our local image.bbclass overlay.

We see frequent issues during do_image_complete especially on the release build jobs like:
https://build.automotivelinux.org/job/release-jjb-eel-snapshot/7/MACHINE=intel-corei7-64,label=agl-test-slave/console

The race window shows particularly well when there is *no* parallelism.
PARALLEL_MAKE = "-j1"
BB_NUMBER_THREADS = "1"

Also the efi bootloader packages in meta-intel seem to particularly trigger this condition
which is caused by a race-condition in the yocto image generation functions and the license file handling.

Bug-AGL: SPEC-643

Change-Id: I2464216b054f360647b7aec461320aa769fde65e
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/11351
Reviewed-by: Thomas Rini <trini@konsulko.com>
Tested-by: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
ci-image-build: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
ci-image-boot-test: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>

meta-agl-bsp/classes/image.bbclass

index d378454..ccaffce 100644 (file)
@@ -159,14 +159,18 @@ IMAGE_TYPE_wic = "image_types_wic"
 inherit ${IMAGE_TYPE_wic}
 
 python () {
+    def extraimage_getdepends(task):
+        deps = ""
+        for dep in (d.getVar('EXTRA_IMAGEDEPENDS') or "").split():
+            deps += " %s:%s" % (dep, task)
+        return deps
+
+    d.appendVarFlag('do_image', 'depends', extraimage_getdepends('do_populate_lic'))
+    d.appendVarFlag('do_image_complete', 'depends', extraimage_getdepends('do_populate_sysroot'))
+
     deps = " " + imagetypes_getdepends(d)
     d.appendVarFlag('do_rootfs', 'depends', deps)
 
-    deps = ""
-    for dep in (d.getVar('EXTRA_IMAGEDEPENDS') or "").split():
-        deps += " %s:do_populate_sysroot" % dep
-    d.appendVarFlag('do_image_complete', 'depends', deps)
-
     #process IMAGE_FEATURES, we must do this before runtime_mapping_rename
     #Check for replaces image features
     features = set(oe.data.typed_value('IMAGE_FEATURES', d))