Add virtual/phosphor-ipmi-sensor-inventory

This virtual provides a YAML file that serves as sensor
inventory configuration for phosphor-host-ipmid.

Add a native recipe that builds the configuration from MRW.
Set this recipe as the default for OpenPOWER systems.

Resolves openbmc/openbmc#781
Resolves openbmc/openbmc#1212

Change-Id: I25034dd3ed825e2ef320ab0b38ac2f733afded47
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb
new file mode 100644
index 0000000..284369d
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb
@@ -0,0 +1,28 @@
+SUMMARY = "sensor config for phosphor-host-ipmid"
+PR = "r1"
+
+inherit native
+inherit obmc-phosphor-license
+inherit phosphor-ipmi-host
+
+SRC_URI += "file://config.yaml"
+
+DEPENDS += " \
+           mrw-native \
+           mrw-perl-tools-native \
+           "
+
+PROVIDES += "virtual/phosphor-ipmi-sensor-inventory"
+
+S = "${WORKDIR}"
+
+do_install() {
+        DEST=${D}${config_datadir}
+        install -d ${DEST}
+
+        ${bindir}/perl-native/perl \
+            ${bindir}/gen_ipmi_sensor.pl \
+            -i ${datadir}/obmc-mrw/${MACHINE}.xml \
+            -m config.yaml \
+            -o ${DEST}/sensor.yaml
+}