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/classes/phosphor-ipmi-host.bbclass b/meta-phosphor/classes/phosphor-ipmi-host.bbclass
new file mode 100644
index 0000000..2857029
--- /dev/null
+++ b/meta-phosphor/classes/phosphor-ipmi-host.bbclass
@@ -0,0 +1 @@
+sensor_datadir="${datadir}/phosphor-ipmi-host/sensor"
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb
index f90984f..3e33e9a 100644
--- a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb
+++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb
@@ -9,11 +9,15 @@
 inherit obmc-phosphor-license
 inherit obmc-phosphor-sdbus-service
 inherit obmc-phosphor-ipmiprovider-symlink
+inherit phosphor-ipmi-host
+inherit pythonnative
 
 DEPENDS += "phosphor-logging"
 DEPENDS += "phosphor-mapper"
 DEPENDS += "autoconf-archive-native"
 DEPENDS += "packagegroup-obmc-ipmid-providers"
+DEPENDS += "virtual/phosphor-ipmi-sensor-inventory"
+
 RDEPENDS_${PN}-dev += "phosphor-logging"
 RDEPENDS_${PN}-dev += "phosphor-mapper-dev"
 RDEPENDS_${PN} += "clear-once"
@@ -32,6 +36,7 @@
         "
 EXTRA_OECONF = " \
         WHITELIST_CONF="${WHITELIST_CONF}" \
+        SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \
         "
 
 S = "${WORKDIR}/git"
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-example-native.bb b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-example-native.bb
new file mode 100644
index 0000000..2f7cc5c
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-example-native.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Sensor config for phosphor-host-ipmi"
+PR = "r1"
+
+inherit native
+inherit phosphor-ipmi-host
+inherit obmc-phosphor-license
+
+PROVIDES += "virtual/phosphor-ipmi-sensor-inventory"
+
+SRC_URI += "file://config.yaml"
+
+S = "${WORKDIR}"
+
+do_install() {
+        # This recipe is supposed to create an output yaml file with
+        # sensor data extracted  from the mrw.
+        # provides a sample output file.
+
+        DEST=${D}${config_datadir}
+        install -d ${DEST}
+        install config.yaml ${DEST}/sensor.yaml
+}
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-example/config.yaml b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-example/config.yaml
new file mode 100644
index 0000000..bbd4ff1
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-example/config.yaml
@@ -0,0 +1,726 @@
+0xa6:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm0
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xa8:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm1
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xba:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm10
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xbc:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm11
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xbe:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm12
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xc0:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm13
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xc2:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm14
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xc4:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm15
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xaa:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm2
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xac:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm3
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xae:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm4
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xb0:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm5
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xb2:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm6
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xb4:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm7
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xb6:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm8
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0xb8:
+  sensorType: 0x0C
+  path: /system/chassis/motherboard/dimm9
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.State.Decorator.OperationalStatus:
+      Functional:
+        0x04:
+          assert: "false"
+          deassert: "true"
+          type: bool
+0x5a:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x12:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core0
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x15:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core1
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x18:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core2
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x1b:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core3
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x1e:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core4
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x21:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core5
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x24:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core6
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x27:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core7
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x2a:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core8
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x2d:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core9
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x30:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core10
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x33:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core11
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x36:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core12
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x39:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core13
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x3c:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core14
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x3f:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core15
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x42:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core16
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x45:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core17
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x48:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core18
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x4b:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core19
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x4e:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core20
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x51:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core21
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x54:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core22
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x57:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu0/core23
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0xa4:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x5c:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core0
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x5f:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core1
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x62:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core2
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x65:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core3
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x68:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core4
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x6b:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core5
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x6e:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core6
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x71:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core7
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x74:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core8
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x77:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core9
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x7a:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core10
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x7d:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core11
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x80:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core12
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x83:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core13
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x86:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core14
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x89:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core15
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x8c:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core16
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x8f:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core17
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x92:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core18
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x95:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core19
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x98:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core20
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x9b:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core21
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0x9e:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core22
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
+0xa1:
+  sensorType: 0x07
+  path: /system/chassis/motherboard/cpu1/core23
+  sensorReadingType: 0x6F
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        0x07:
+          deassert: "false"
+          assert: "true"
+          type: bool
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
+}
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw/config.yaml b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw/config.yaml
new file mode 100644
index 0000000..1830611
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw/config.yaml
@@ -0,0 +1,27 @@
+0x0C:
+  xyz.openbmc_project.State.Decorator.OperationalStatus:
+    Functional:
+      0x04:
+        type:   "bool"
+        assert:  false
+        deassert: true
+  xyz.openbmc_project.Inventory.Item:
+    Present:
+      0x06:
+        type: "bool"
+        assert: true
+        deassert: false
+
+0x07:
+  xyz.openbmc_project.State.Decorator.OperationalStatus:
+    Functional:
+      0x08:
+        type:   "bool"
+        assert: false
+        deassert: true
+  xyz.openbmc_project.Inventory.Item:
+    Present:
+      0x07:
+        type: "bool"
+        assert: true
+        deassert: false
diff --git a/meta-phosphor/conf/distro/include/phosphor-defaults.inc b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
index 954264d..d9d532a 100644
--- a/meta-phosphor/conf/distro/include/phosphor-defaults.inc
+++ b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
@@ -108,5 +108,14 @@
 PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native ?= \
     "${@cf_enabled(d, 'obmc-mrw', 'phosphor-led-manager-config-mrw-native', 'phosphor-led-manager-config-example-native')}"
 
+# The phosphor-host-ipmid application is data-driven and requires an input
+# mapping of IPMI inventory sensor metadata to DBus objects interfaces and properties.
+# This virtual is a native recipe that provides that mapping by installing
+# configuration files in the format and native sysroot location expected by
+# the phosphor-host-ipmid build process in the native sysroot.
+PREFERRED_PROVIDER_virtual/phosphor-ipmi-sensor-inventory ?= \
+    "${@cf_enabled(d, 'obmc-mrw', 'phosphor-ipmi-sensor-inventory-mrw-native', 'phosphor-ipmi-sensor-inventory-example-native')}"
+
+
 OBMC_DBUS_PATH_ROOT ?= "/xyz/openbmc_project"
 OBMC_DBUS_IFACE_ROOT ?= "xyz.openbmc_project"