Generate system inventory data from MRW XML.

This will fetch a script from the phosphor-mrw-tools repo
and use it to generate the system inventory data from
the machine readable workbook XML.  The resulting .json
file will go into the flash image for use on the system.

Change-Id: I888ea51a2a75d915238776be568960e0898d6106
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/common/recipes-phosphor/obmc-phosphor-inventory/obmc-inventory.bb b/common/recipes-phosphor/obmc-phosphor-inventory/obmc-inventory.bb
new file mode 100644
index 0000000..55cc501
--- /dev/null
+++ b/common/recipes-phosphor/obmc-phosphor-inventory/obmc-inventory.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Phosphor Inventory Generation"
+DESCRIPTION = "Generates inventory data from the machine readable workbook"
+PR = "r1"
+
+S = "${WORKDIR}/git"
+
+RPROVIDES_${PN} = "virtual-system-inventory-data"
+
+inherit allarch
+inherit obmc-phosphor-license
+
+DEPENDS += "mrw-native mrw-api-native"
+
+SRC_URI += "git://github.com/openbmc/phosphor-mrw-tools"
+SRCREV = "ab015d7e2a2eb87eab2ca7d731ebcb7a873442e9"
+
+FILES_${PN} += "${datadir}/inventory"
+
+do_compile() {
+    ${STAGING_BINDIR_NATIVE}/perl-native/perl ${S}/inventory.pl \
+        -x ${STAGING_DATADIR_NATIVE}/obmc-mrw/${MACHINE}.xml -o inventory.json
+}
+
+do_install() {
+    install -d ${D}${datadir}/inventory
+    install -m 0644 inventory.json ${D}${datadir}/inventory/inventory.json
+}