overlay: remove OBMC_PHOSPHOR_IMAGE_OVERLAY

Solve the problem resulting in the addition of this variable
differently, such that it can be removed and image type
selection can be selected in the standard way using IMAGE_FSTYPES.

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: Ice94e8f278f00b8b4d344244bfb87dddeb173a23
diff --git a/meta-phosphor/classes/image_types_phosphor.bbclass b/meta-phosphor/classes/image_types_phosphor.bbclass
new file mode 100644
index 0000000..eef1b1c
--- /dev/null
+++ b/meta-phosphor/classes/image_types_phosphor.bbclass
@@ -0,0 +1,16 @@
+# Base image class extension, inlined into every image.
+
+def build_uboot(d):
+    fstypes = d.getVar('IMAGE_FSTYPES', True).split()
+    if any([x.endswith('u-boot') for x in fstypes]):
+        return 'image_types_uboot'
+    return ''
+
+
+# Inherit u-boot classes if legacy uboot images are in use.
+IMAGE_TYPE_uboot = '${@build_uboot(d)}'
+inherit ${IMAGE_TYPE_uboot}
+
+# Inherit the overlay class if overlay is in use.
+IMAGE_TYPE_overlay = '${@bb.utils.contains("IMAGE_FSTYPES", "overlay", "image-overlay", "", d)}'
+inherit ${IMAGE_TYPE_overlay}