meta-google: flash: Import inplace-gbmc-update

Google BMC inplace update script and bitbake recipe.

Google-Bug-Id: 179618162
Upstream: 22e2c3dd5f610777dee173a09d8e82dc2509a975
Signed-off-by: Brandon Kim <brandonkim@google.com>
Change-Id: Ia1beded107382dacb9f2f7e3cb9bbd86ae99d8c1
diff --git a/meta-google/recipes-phosphor/flash/inplace-gbmc-update.bb b/meta-google/recipes-phosphor/flash/inplace-gbmc-update.bb
new file mode 100644
index 0000000..c71a579
--- /dev/null
+++ b/meta-google/recipes-phosphor/flash/inplace-gbmc-update.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Google BMC Inplace Update Script"
+DESCRIPTION = "Google BMC Inplace Update Script"
+PR = "r1"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit obmc-phosphor-systemd
+
+PROVIDES += "virtual/bmc-update"
+RPROVIDES_${PN} += "virtual/bmc-update"
+
+RDEPENDS_${PN} += "google-key"
+RDEPENDS_${PN} += "bash"
+
+SRC_URI += " \
+ file://config-bmc.json \
+ file://inplace-gbmc-verify.service \
+ file://inplace-gbmc-verify.sh \
+ file://inplace-gbmc-version.service \
+ file://inplace-gbmc-version.sh \
+"
+
+SYSTEMD_SERVICE_${PN} += "inplace-gbmc-verify.service"
+SYSTEMD_SERVICE_${PN} += "inplace-gbmc-version.service"
+
+FILES_${PN} += "${datadir}/phosphor-ipmi-flash"
+
+do_install() {
+    sed -i 's,@ALLOW_DEV@,,' ${WORKDIR}/inplace-gbmc-verify.sh
+
+    install -d ${D}${bindir}
+    install -m 0755 ${WORKDIR}/*.sh ${D}${bindir}
+
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/*.service ${D}${systemd_system_unitdir}
+
+    install -d ${D}${datadir}/phosphor-ipmi-flash
+    install -m 0644 ${WORKDIR}/config-bmc.json ${D}${datadir}/phosphor-ipmi-flash
+}
+
+do_install_prepend_dev() {
+    sed -i 's,@ALLOW_DEV@,--allow-dev,' ${WORKDIR}/inplace-gbmc-verify.sh
+}