Convert openpower-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.

Change-Id: I57f3bc244523eff5bc043caff8365e334d98cb30
Tested: Built a witherspoon image and validate manifest
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-core/systemd/systemd_%.bbappend b/meta-openbmc-machines/meta-openpower/common/recipes-core/systemd/systemd_%.bbappend
index 7519404..e576d8e 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-core/systemd/systemd_%.bbappend
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-core/systemd/systemd_%.bbappend
@@ -1,11 +1,11 @@
-SRC_URI += "${@mf_enabled(d, 'openpower-ubi-fs', 'file://software.conf')}"
+SRC_URI += "${@df_enabled(d, 'openpower-ubi-fs', 'file://software.conf')}"
 
 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.
 
-        if ${@bb.utils.contains('MACHINE_FEATURES', 'openpower-ubi-fs', 'true', 'false', d)}; then
+        if ${@bb.utils.contains('DISTRO_FEATURES', 'openpower-ubi-fs', 'true', 'false', d)}; then
                 install -m 0644 ${WORKDIR}/software.conf ${D}${exec_prefix}/lib/tmpfiles.d/
         fi
 }
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-op-apps.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-op-apps.bb
index d4e8d20..b3783d8 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-op-apps.bb
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/packagegroups/packagegroup-op-apps.bb
@@ -45,10 +45,15 @@
 SUMMARY_${PN}-flash = "OpenPOWER Flash"
 RDEPENDS_${PN}-flash = " \
         obmc-control-bmc \
-        ${@mf_enabled(d, 'openpower-ubi-fs', \
-            'openpower-software-manager', \
-            'obmc-flash-bios obmc-mgr-download obmc-op-flasher')} \
+        obmc-flash-bios \
+        obmc-mgr-download \
+        obmc-op-flasher \
         "
+RDEPENDS_${PN}-flash_df-openpower-ubi-fs = " \
+        obmc-control-bmc \
+        openpower-software-manager \
+        "
+
 
 SUMMARY_${PN}-system = "OpenPOWER System"
 RDEPENDS_${PN}-system = " \
diff --git a/meta-openbmc-machines/meta-openpower/conf/distro/include/openpower-ubi.inc b/meta-openbmc-machines/meta-openpower/conf/distro/include/openpower-ubi.inc
new file mode 100644
index 0000000..cb488c8
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/conf/distro/include/openpower-ubi.inc
@@ -0,0 +1,2 @@
+DISTRO_FEATURES += "openpower-ubi-fs"
+DISTROOVERRIDES .= ":df-openpower-ubi-fs"
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/distro/openbmc-witherspoon.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/distro/openbmc-witherspoon.conf
index c00930a..543e7f9 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/distro/openbmc-witherspoon.conf
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/distro/openbmc-witherspoon.conf
@@ -1,3 +1,4 @@
 require conf/distro/include/phosphor-base.inc
 require conf/distro/include/phosphor-ubi.inc
 require conf/distro/include/openpower-mrw.inc
+require conf/distro/include/openpower-ubi.inc
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf
index 13831a7..75ef287 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/conf/machine/witherspoon.conf
@@ -3,8 +3,6 @@
 
 UBOOT_MACHINE = "ast_g5_ncsi_config"
 
-OBMC_MACHINE_FEATURES += "openpower-ubi-fs"
-
 OBMC_POWER_SUPPLY_INSTANCES = "0 1"
 
 PREFERRED_PROVIDER_virtual/p9-vcs-workaround = ''
diff --git a/meta-phosphor/common/recipes-phosphor/mboxd/mboxd.bb b/meta-phosphor/common/recipes-phosphor/mboxd/mboxd.bb
index d60c23a..f90ab86 100644
--- a/meta-phosphor/common/recipes-phosphor/mboxd/mboxd.bb
+++ b/meta-phosphor/common/recipes-phosphor/mboxd/mboxd.bb
@@ -46,6 +46,6 @@
 SYSTEMD_SERVICE_${PN} += "mboxd-reload@.service"
 SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}"
 
-# Enable virtual-pnor by MACHINE_FEATURE openpower-ubi-fs.
-PACKAGECONFIG_append = "${@mf_enabled(d, 'openpower-ubi-fs', 'virtual-pnor')}"
+# Enable virtual-pnor by DISTRO_FEATURE openpower-ubi-fs.
+PACKAGECONFIG_append_df-openpower-ubi-fs = "virtual-pnor"
 PACKAGECONFIG[virtual-pnor] = "--enable-virtual-pnor,--disable-virtual-pnor"