Don't load non-UBI flash packages on UBI systems

Two un-needed applications are getting installed and started on
UBI enabled systems:

- download_manager.py (obmc-mgr-download.bb)
- bmc_update.py (obmc-flash-bmc.bb)

Remove these if it is a BMC UBI enabled system.

Moved all of the BMC flash logic to the phosphor layer where
it really belongs since the ability to update your OpenBMC
should come by default when bringing in phosphor.

Tested: Verified 2 python applications not present on witherspoon and
system boots and code updates fine. Verified romulus image still had
python applications and made it to Ready states.

Resolves openbmc/openbmc#2480

Change-Id: I42317ece1b75fd6bb05e766e486dfecdb7d4ccf3
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
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 4f12335..d4e8d20 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
@@ -44,7 +44,7 @@
 
 SUMMARY_${PN}-flash = "OpenPOWER Flash"
 RDEPENDS_${PN}-flash = " \
-        obmc-flash-bmc obmc-mgr-download obmc-control-bmc \
+        obmc-control-bmc \
         ${@mf_enabled(d, 'openpower-ubi-fs', \
             'openpower-software-manager', \
             'obmc-flash-bios obmc-mgr-download obmc-op-flasher')} \
diff --git a/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb b/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
index 2f4b50d..f014f17 100644
--- a/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
+++ b/meta-phosphor/common/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb
@@ -93,7 +93,15 @@
 RDEPENDS_${PN}-software = " \
         ${VIRTUAL-RUNTIME_obmc-bmc-download-mgr} \
         ${VIRTUAL-RUNTIME_obmc-bmc-updater} \
+        ${VIRTUAL-RUNTIME_obmc-bmc-version} \
         "
+# Determine if the non-UBI flash packages are required
+RDEPENDS_${PN}-software += " \
+        ${@mf_enabled(d, 'obmc-ubi-fs', \
+            '', \
+            'obmc-flash-bmc obmc-mgr-download')} \
+        "
+
 SUMMARY_${PN}-debug-collector = "BMC debug collector"
 RDEPENDS_${PN}-debug-collector = " \
         ${VIRTUAL-RUNTIME_obmc-dump-manager} \
diff --git a/meta-phosphor/conf/distro/include/phosphor-defaults.inc b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
index 5387f93..3158c8f 100644
--- a/meta-phosphor/conf/distro/include/phosphor-defaults.inc
+++ b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
@@ -83,6 +83,12 @@
 # interface.
 VIRTUAL-RUNTIME_obmc-bmc-download-mgr ?= "phosphor-software-manager-download-mgr"
 
+# obmc-bmc-version
+#
+# Provides an implementation of the xyz.openbmc_project.Software.Version
+# interface.
+VIRTUAL-RUNTIME_obmc-bmc-version ?= "phosphor-software-manager-version"
+
 # obmc-bmc-updater
 #
 # Provides an implementation of the xyz.openbmc_project.Software.Activation