Convert obmc-ubi-fs to a distro feature

As with MRW the use of the UBI image scheme is distro policy.
Convert the existing machine feature to a distro feature.

Enable the new distro feature on the systems that use
it(Witherspoon).

Add a distro override and fix-up MF checks to use this override
instead for improved readability.

Tested: Built a Witherspoon image and validated image
Change-Id: I8ab03115bbfc2ecc77cff5c9eb8628903ae88051
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/common/recipes-core/systemd/systemd_%.bbappend b/common/recipes-core/systemd/systemd_%.bbappend
index 134bab5..7519404 100644
--- a/common/recipes-core/systemd/systemd_%.bbappend
+++ b/common/recipes-core/systemd/systemd_%.bbappend
@@ -1,13 +1,23 @@
 SRC_URI += "${@mf_enabled(d, 'openpower-ubi-fs', 'file://software.conf')}"
 
-do_install_append() {
-
+install_tmpfile() {
         # /tmp/images is the software image upload directory.
         # It should not be deleted since it is watched by the Image Manager for
-        # new images. Don't install software.conf if obmc-ubi-fs is set since
-        # the bbappend in the meta-phosphor layer already installs if
-        # obmc-ubi-fs is set.
-        if ${@bb.utils.contains('MACHINE_FEATURES', 'openpower-ubi-fs', 'true', 'false', d)} && ! ${@bb.utils.contains('MACHINE_FEATURES', 'obmc-ubi-fs', 'true', 'false', d)}; then
+        # new images.
+
+        if ${@bb.utils.contains('MACHINE_FEATURES', 'openpower-ubi-fs', 'true', 'false', d)}; then
                 install -m 0644 ${WORKDIR}/software.conf ${D}${exec_prefix}/lib/tmpfiles.d/
         fi
 }
+
+install_tmpfile_df-obmc-ubi-fs() {
+        # Don't install software.conf if obmc-ubi-fs is set since
+        # the bbappend in the meta-phosphor layer already installs
+        # if obmc-ubi-fs is set.
+
+        :
+}
+
+do_install_append() {
+        install_tmpfile
+}
diff --git a/meta-ibm/meta-witherspoon/conf/distro/openbmc-witherspoon.conf b/meta-ibm/meta-witherspoon/conf/distro/openbmc-witherspoon.conf
index 27bf881..c00930a 100644
--- a/meta-ibm/meta-witherspoon/conf/distro/openbmc-witherspoon.conf
+++ b/meta-ibm/meta-witherspoon/conf/distro/openbmc-witherspoon.conf
@@ -1,2 +1,3 @@
 require conf/distro/include/phosphor-base.inc
+require conf/distro/include/phosphor-ubi.inc
 require conf/distro/include/openpower-mrw.inc
diff --git a/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf b/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf
index 5d2f25f..13831a7 100644
--- a/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf
+++ b/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf
@@ -3,7 +3,7 @@
 
 UBOOT_MACHINE = "ast_g5_ncsi_config"
 
-OBMC_MACHINE_FEATURES += "obmc-ubi-fs openpower-ubi-fs"
+OBMC_MACHINE_FEATURES += "openpower-ubi-fs"
 
 OBMC_POWER_SUPPLY_INSTANCES = "0 1"