meta-yadro: vesnin: new YAML dependency scheme

All the IPMI virtuals and PREFERRED_PROVIDERS in meta-phosphor are in
the process of being deprecated.  Prepare for that and move to a simpler
scheme for providing the YAML configuration for Vesnin systems.

(From meta-yadro rev: 9c29d1b377aafa400444273bfb7fdd28b0803f34)

Change-Id: Id243bb4e0f2c742ebb1124195a16b9ce20856091
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-yadro/meta-vesnin/conf/machine/vesnin.conf b/meta-yadro/meta-vesnin/conf/machine/vesnin.conf
index fc448de..6ba66fa 100644
--- a/meta-yadro/meta-vesnin/conf/machine/vesnin.conf
+++ b/meta-yadro/meta-vesnin/conf/machine/vesnin.conf
@@ -14,8 +14,6 @@
 
 SERIAL_CONSOLES = "115200;ttyS2 115200;ttyS4"
 
-PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-inventory = "vesnin-ipmi-inventory-map-native"
-PREFERRED_PROVIDER_virtual/phosphor-ipmi-fru-read-inventory = "vesnin-ipmi-inventory-map-read-native"
 PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "vesnin-led-manager-config-native"
 PREFERRED_PROVIDER_virtual/openpower-fru-properties = "vesnin-openpower-fru-properties-native"
 PREFERRED_PROVIDER_virtual/openpower-fru-vpd-layout = "vesnin-openpower-fru-vpd-layout-native"
diff --git a/meta-yadro/meta-vesnin/recipes-phosphor/configuration/vesnin-yaml-config.bb b/meta-yadro/meta-vesnin/recipes-phosphor/configuration/vesnin-yaml-config.bb
new file mode 100644
index 0000000..dc786e5
--- /dev/null
+++ b/meta-yadro/meta-vesnin/recipes-phosphor/configuration/vesnin-yaml-config.bb
@@ -0,0 +1,23 @@
+SUMMARY = "YAML configuration for Vesnin"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${YADROBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
+
+inherit allarch
+
+SRC_URI = " \
+    file://vesnin-ipmi-fru.yaml \
+    "
+
+S = "${WORKDIR}"
+
+do_install() {
+    install -m 0644 -D vesnin-ipmi-fru.yaml \
+        ${D}${datadir}/${BPN}/ipmi-fru-read.yaml
+}
+
+FILES_${PN}-dev = " \
+    ${datadir}/${BPN}/ipmi-fru-read.yaml \
+    "
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/vesnin-ipmi-inventory-map/config.yaml b/meta-yadro/meta-vesnin/recipes-phosphor/configuration/vesnin-yaml-config/vesnin-ipmi-fru.yaml
similarity index 100%
rename from meta-yadro/meta-vesnin/recipes-phosphor/ipmi/vesnin-ipmi-inventory-map/config.yaml
rename to meta-yadro/meta-vesnin/recipes-phosphor/configuration/vesnin-yaml-config/vesnin-ipmi-fru.yaml
diff --git a/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend b/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend
new file mode 100644
index 0000000..3ee4501
--- /dev/null
+++ b/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend
@@ -0,0 +1,5 @@
+DEPENDS_append_vesnin = " vesnin-yaml-config"
+
+EXTRA_OECONF_vesnin = " \
+    YAML_GEN=${STAGING_DIR_HOST}${datadir}/vesnin-yaml-config/ipmi-fru-read.yaml \
+    "
diff --git a/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
new file mode 100644
index 0000000..cf846c7
--- /dev/null
+++ b/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
@@ -0,0 +1,5 @@
+DEPENDS_append_vesnin = " vesnin-yaml-config"
+
+EXTRA_OECONF_vesnin = " \
+    FRU_YAML_GEN=${STAGING_DIR_HOST}${datadir}/vesnin-yaml-config/ipmi-fru-read.yaml \
+    "
diff --git a/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/vesnin-ipmi-inventory-map-native.bb b/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/vesnin-ipmi-inventory-map-native.bb
deleted file mode 100644
index efea936..0000000
--- a/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/vesnin-ipmi-inventory-map-native.bb
+++ /dev/null
@@ -1,23 +0,0 @@
-SUMMARY = "Vesnin IPMI to DBus Inventory mapping."
-PR = "r1"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://${YADROBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
-
-inherit native
-inherit phosphor-ipmi-fru
-
-SRC_URI += "file://config.yaml"
-
-PROVIDES += "virtual/phosphor-ipmi-fru-inventory"
-
-S = "${WORKDIR}"
-
-do_install() {
-        # TODO: install this to inventory_datadir
-        # after ipmi-fru-parser untangles the host
-        # firmware config from the machine inventory.
-        DEST=${D}${config_datadir}
-
-        install -d ${DEST}
-        install config.yaml ${DEST}
-}
diff --git a/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/vesnin-ipmi-inventory-map-read-native.bb b/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/vesnin-ipmi-inventory-map-read-native.bb
deleted file mode 100644
index e4d3bd5..0000000
--- a/meta-yadro/meta-vesnin/recipes-phosphor/ipmi/vesnin-ipmi-inventory-map-read-native.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-SUMMARY = "Vesnin IPMI to DBus Inventory mapping."
-PR = "r1"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://${YADROBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
-
-inherit native
-inherit phosphor-ipmi-host
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/vesnin-ipmi-inventory-map:"
-
-SRC_URI += "file://config.yaml"
-
-PROVIDES += "virtual/phosphor-ipmi-fru-read-inventory"
-
-S = "${WORKDIR}"
-
-do_install() {
-        # TODO: install this to inventory_datadir
-        # after ipmi-fru-parser untangles the host
-        # firmware config from the machine inventory.
-        DEST=${D}${config_datadir}
-
-        install -d ${DEST}
-        install config.yaml ${DEST}
-}