Create image class image-overlay and move phosphor to use it

This commit creates a new class image-overlay based on how the
image-live class is structured.  It takes parameters for the base
and overlayed file system types but the initfs only support ext4
over squashfs presently.

It then moves invoking the generation of the flash image from a
post image creation command to a separate task invoked from the
overlay image so that building the initramfs image by itself does
not try to create a flash image.

Signed-off-by: Milton Miller <miltonm@us.ibm.com>
diff --git a/meta-phosphor/classes/image-overlay.bbclass b/meta-phosphor/classes/image-overlay.bbclass
new file mode 100644
index 0000000..1c6137d
--- /dev/null
+++ b/meta-phosphor/classes/image-overlay.bbclass
@@ -0,0 +1,18 @@
+
+INITRD_IMAGE ?= "core-image-minimal-initramfs"
+INITRD ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.${INITRD_CTYPE}${uboot}"
+
+IMAGE_BASETYPE ?= "squashfs-xz"
+OVERLAY_BASETYPE ?= "ext4"
+
+IMAGE_TYPES_${PN} += "${IMAGE_BASETYPE}"
+
+IMAGE_TYPEDEP_overlay = "${IMAGE_BASETYPE} ${OVERLAY_BASETYPE}"
+IMAGE_TYPES_MASKED += "overlay"
+
+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