[PATCH openbmc 2/2] Don't inherit image-overlay by default

OpenBMC Patches openbmc-patches at stwcx.xyz
Tue Mar 1 05:40:23 AEDT 2016


From: Brad Bishop <bradleyb at fuzziesquirrel.com>

This attempts to address a race condition in the build where
we attempt to build a complete flash image before all the sub-images
are available (specifically the initramfs image).

Any classes in IMAGE_CLASSES are inherited by all image recipes, including
the initramfs image.  OE-Core's live/hddimg recipes address this
by pulling in the class configuration in recipe scope, rather than
global scope.  Copy that behavior here.
---
 meta-phosphor/classes/image-overlay.bbclass            | 8 +++++---
 meta-phosphor/classes/obmc-phosphor-image.bbclass      | 7 +++++++
 meta-phosphor/conf/machine/include/obmc-bsp-common.inc | 1 -
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/meta-phosphor/classes/image-overlay.bbclass b/meta-phosphor/classes/image-overlay.bbclass
index 8997aae..71768a6 100644
--- a/meta-phosphor/classes/image-overlay.bbclass
+++ b/meta-phosphor/classes/image-overlay.bbclass
@@ -1,3 +1,5 @@
+PACKAGES = " "
+EXCLUDE_FROM_WORLD = "1"
 
 INITRD_IMAGE ?= "core-image-minimal-initramfs"
 INITRD ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.${INITRD_CTYPE}${uboot}"
@@ -5,9 +7,9 @@ INITRD ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.${INITRD_CTYPE}${
 IMAGE_BASETYPE ?= "squashfs-xz"
 OVERLAY_BASETYPE ?= "jffs2"
 
-IMAGE_TYPES_${PN} += "${IMAGE_BASETYPE}"
+IMAGE_TYPES += "overlay"
 
-IMAGE_TYPEDEP_overlay = "${IMAGE_BASETYPE} ${OVERLAY_BASETYPE}"
+IMAGE_TYPEDEP_overlay = "${IMAGE_BASETYPE}"
 IMAGE_TYPES_MASKED += "overlay"
 
 ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.${IMAGE_BASETYPE}"
@@ -15,4 +17,4 @@ ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.${IMAGE_BASETYPE}"
 do_generate_flash[depends] += "${INITRD_IMAGE}:do_rootfs"
 do_generate_flash[depends] += "${PN}:do_rootfs"
 
-addtask generate_flash after do_rootfs before do_build
+addtask generate_flash before do_build
diff --git a/meta-phosphor/classes/obmc-phosphor-image.bbclass b/meta-phosphor/classes/obmc-phosphor-image.bbclass
index 811bbd3..0d4a0d0 100644
--- a/meta-phosphor/classes/obmc-phosphor-image.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-image.bbclass
@@ -42,3 +42,10 @@ IMAGE_INSTALL += " \
         i2c-tools \
         screen \
         "
+
+def build_overlay(d):
+        if bb.utils.contains("IMAGE_FSTYPES", "overlay", "overlay", "0", d) != "0":
+                return "image-overlay"
+        return ""
+
+inherit ${@build_overlay(d)}
diff --git a/meta-phosphor/conf/machine/include/obmc-bsp-common.inc b/meta-phosphor/conf/machine/include/obmc-bsp-common.inc
index fb6cc8c..60ed088 100644
--- a/meta-phosphor/conf/machine/include/obmc-bsp-common.inc
+++ b/meta-phosphor/conf/machine/include/obmc-bsp-common.inc
@@ -17,7 +17,6 @@ IMAGE_FSTYPES += "overlay"
 IMAGE_INSTALL += "u-boot-fw-utils"
 
 IMAGE_CLASSES += "obmc-phosphor-image_types_uboot"
-IMAGE_CLASSES += "image-overlay"
 
 INITRAMFS_CTYPE ?= "lzma"
 INITRAMFS_FSTYPES += "cpio.${INITRAMFS_CTYPE}"
-- 
2.7.1




More information about the openbmc mailing list