meta-google: add recipe to disable/enable host console

Add a service that will trigger by gbmc-bare-metal-active target, upon
start/stop it will disable/re-enable obmc host console.

Tested: manually tested with stopping/starting the target

Change-Id: Ia57c825708bfe16f8f7967f6636d90327d28b5c0
Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com>
diff --git a/meta-google/recipes-google/bare-metal-obmc-console/bare-metal-obmc-console.bb b/meta-google/recipes-google/bare-metal-obmc-console/bare-metal-obmc-console.bb
new file mode 100644
index 0000000..0fc0ca4
--- /dev/null
+++ b/meta-google/recipes-google/bare-metal-obmc-console/bare-metal-obmc-console.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Disable obmc-console while the customer's host OS is running"
+DESCRIPTION = "Disable obmc-console while an untrusted host OS is running"
+PR = "r1"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit systemd
+
+SRC_URI += " \
+  file://disable-obmc-console.service \
+  file://disable_obmc_console.sh \
+"
+
+DEPENDS += "systemd"
+
+RDEPENDS:${PN}:append = " \
+  bash \
+  bare-metal-active \
+  "
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE:${PN} = " \
+  disable-obmc-console.service \
+  "
+
+do_install:append() {
+  install -d ${D}${systemd_system_unitdir}
+  install -m 0644 ${WORKDIR}/disable-obmc-console.service ${D}${systemd_system_unitdir}
+  install -d -m0755 ${D}${libexecdir}
+  install -m0755 ${WORKDIR}/disable_obmc_console.sh ${D}${libexecdir}/
+}