meta-phosphor: split image type configs to includes
We have reached branch-capacity in the bb.utils.contains checks
at 3 image types. In order to be able to more easily add additional
image types, split the differences out into additional inc-snippets
for each image type.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ibcdb5c885c67cb6d8728dfd315eb07f99b1a2173
diff --git a/meta-ibm/conf/machine/p10bmc.conf b/meta-ibm/conf/machine/p10bmc.conf
index 98723ca..a0ad416 100644
--- a/meta-ibm/conf/machine/p10bmc.conf
+++ b/meta-ibm/conf/machine/p10bmc.conf
@@ -11,13 +11,13 @@
OBMC_POWER_SUPPLY_INSTANCES = "0 1 2 3"
+require conf/distro/include/phosphor-mmc.inc
require conf/machine/include/ast2600.inc
require conf/machine/include/obmc-bsp-common.inc
require conf/machine/include/openpower.inc
include conf/machine/include/ibm-power10-cpu.inc
require conf/distro/include/openpower-virtual-pnor.inc
require conf/distro/include/openpower-hostfw-over-pldm.inc
-require conf/distro/include/phosphor-mmc.inc
require conf/distro/include/ibm-mpreboot.inc
require conf/distro/include/ibm-yaml.inc
DISTRO_FEATURES += "ibm-service-account-policy"
diff --git a/meta-phosphor/conf/machine/include/image-type/mmc.inc b/meta-phosphor/conf/machine/include/image-type/mmc.inc
new file mode 100644
index 0000000..07d5db4
--- /dev/null
+++ b/meta-phosphor/conf/machine/include/image-type/mmc.inc
@@ -0,0 +1,2 @@
+IMAGE_FSTYPES += "wic.xz mmc-ext4-tar"
+INITRAMFS_IMAGE = "obmc-phosphor-initramfs"
diff --git a/meta-phosphor/conf/machine/include/image-type/static.inc b/meta-phosphor/conf/machine/include/image-type/static.inc
new file mode 100644
index 0000000..d714e1b
--- /dev/null
+++ b/meta-phosphor/conf/machine/include/image-type/static.inc
@@ -0,0 +1,2 @@
+IMAGE_FSTYPES += "mtd-static mtd-static-tar mtd-static-alltar"
+INITRAMFS_IMAGE = "obmc-phosphor-initramfs"
diff --git a/meta-phosphor/conf/machine/include/image-type/ubi-fs.inc b/meta-phosphor/conf/machine/include/image-type/ubi-fs.inc
new file mode 100644
index 0000000..62e66a6
--- /dev/null
+++ b/meta-phosphor/conf/machine/include/image-type/ubi-fs.inc
@@ -0,0 +1,2 @@
+IMAGE_FSTYPES += "mtd-ubi mtd-ubi-tar"
+INITRAMFS_IMAGE = ""
diff --git a/meta-phosphor/conf/machine/include/obmc-bsp-common.inc b/meta-phosphor/conf/machine/include/obmc-bsp-common.inc
index 9098a8a..8a38343 100644
--- a/meta-phosphor/conf/machine/include/obmc-bsp-common.inc
+++ b/meta-phosphor/conf/machine/include/obmc-bsp-common.inc
@@ -5,25 +5,11 @@
KERNEL_CLASSES ?= "kernel-fitimage"
KERNEL_IMAGETYPES ?= "fitImage vmlinux"
-# Static images. This is the default if no other layout is specified.
-IMAGE_FSTYPES += "${@bb.utils.contains_any('DISTRO_FEATURES', \
- 'obmc-ubi-fs phosphor-mmc', \
- '', \
- 'mtd-static mtd-static-tar mtd-static-alltar', d)}"
+OBMC_IMAGE_INCLUDE = "static"
+OBMC_IMAGE_INCLUDE:df-obmc-ubi-fs = "ubi-fs"
+OBMC_IMAGE_INCLUDE:df-phosphor-mmc = "mmc"
-# UBI images.
-IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', \
- 'obmc-ubi-fs', \
- 'mtd-ubi mtd-ubi-tar', \
- '', d)}"
-
-# eMMC images.
-IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', \
- 'phosphor-mmc', \
- 'wic.xz mmc-ext4-tar', \
- '', d)}"
+require conf/machine/include/image-type/${OBMC_IMAGE_INCLUDE}.inc
INITRAMFS_CTYPE ?= "xz"
INITRAMFS_FSTYPES = "cpio.${INITRAMFS_CTYPE}"
-INITRAMFS_IMAGE = "obmc-phosphor-initramfs"
-INITRAMFS_IMAGE:df-obmc-ubi-fs = ""