[PATCH openbmc v8 04/11] meta-phosphor: Make image-overlay an optional feature

OpenBMC Patches openbmc-patches at stwcx.xyz
Sat Jun 25 06:10:37 AEST 2016


From: Patrick Williams <patrick at stwcx.xyz>

Previously, obmc-bsp-common.inc added "overlay" to the IMAGE_FSTYPES
but this only has meaning if the 'image-overlay' class is used.  The
obmc-phosphor-image class explicitly includes 'image-overlay' when
appropriate but no other images (ie. ones that come with yocto) do.

Changed obmc-bsp-common to instead enable an obmc-phosphor-image feature
by setting OBMC_PHOSPHOR_IMAGE_OVERLAY=1. Then in obmc-phosphor-image we
add "overlay" to the IMAGE_FSTYPES only when the feature is enabled.

This will fix both non-phosphor images on hardware platforms and all images
on simulation platforms.

Signed-off-by: Patrick Williams <patrick at stwcx.xyz>
---
 meta-phosphor/classes/obmc-phosphor-image.bbclass      | 11 ++++++-----
 meta-phosphor/conf/machine/include/obmc-bsp-common.inc |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta-phosphor/classes/obmc-phosphor-image.bbclass b/meta-phosphor/classes/obmc-phosphor-image.bbclass
index d3960c7..2d97cde 100644
--- a/meta-phosphor/classes/obmc-phosphor-image.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-image.bbclass
@@ -48,9 +48,10 @@ CORE_IMAGE_EXTRA_INSTALL_append = " bash \
 
 OBMC_IMAGE_EXTRA_INSTALL ?= ""
 
-def build_overlay(d):
-        if bb.utils.contains("IMAGE_FSTYPES", "overlay", "overlay", "0", d) != "0":
-                return "image-overlay"
-        return ""
+def image_overlay_enabled(d, ifEnabledStr):
+        if d.getVar('OBMC_PHOSPHOR_IMAGE_OVERLAY', True) != "1":
+            return ""
+        return ifEnabledStr
 
-inherit ${@build_overlay(d)}
+IMAGE_FSTYPES += "${@image_overlay_enabled(d, "overlay")}"
+inherit ${@image_overlay_enabled(d, "image-overlay")}
diff --git a/meta-phosphor/conf/machine/include/obmc-bsp-common.inc b/meta-phosphor/conf/machine/include/obmc-bsp-common.inc
index 8d1fd7e..2b6a163 100644
--- a/meta-phosphor/conf/machine/include/obmc-bsp-common.inc
+++ b/meta-phosphor/conf/machine/include/obmc-bsp-common.inc
@@ -13,7 +13,7 @@ UBOOT_SUFFIX ?= "bin"
 
 MACHINEOVERRIDES =. "openbmc:"
 
-IMAGE_FSTYPES += "overlay"
+OBMC_PHOSPHOR_IMAGE_OVERLAY= "1"
 IMAGE_FSTYPES += "cpio.${INITRAMFS_CTYPE}.u-boot"
 OBMC_IMAGE_EXTRA_INSTALL_append = " u-boot-fw-utils"
 
-- 
2.9.0




More information about the openbmc mailing list