meta-bletchley: introduce bletchley-system-state-init
Because Bletchley does not have IPMI between Bmc & Host, the Host init
state will set to Off after Bmc booted. We require an extra service to
check and set Host state & Chassis power state to correct state before
doing any power action or power policy restore.
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I680bc62559ea6f7df6dbe171b54d2cda0c7ae0d4
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/plat-tools/bletchley-common-tool_0.1.bb b/meta-facebook/meta-bletchley/recipes-bletchley/plat-tools/bletchley-common-tool_0.1.bb
new file mode 100644
index 0000000..170463f
--- /dev/null
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/plat-tools/bletchley-common-tool_0.1.bb
@@ -0,0 +1,23 @@
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit obmc-phosphor-systemd
+
+RDEPENDS:${PN} += " bash motor-ctrl"
+
+SRC_URI += " \
+ file://bletchley-system-state-init \
+ file://bletchley-system-state-init@.service \
+ "
+
+do_install() {
+ install -d ${D}${libexecdir}
+ install -m 0755 ${WORKDIR}/bletchley-system-state-init ${D}${libexecdir}
+}
+
+
+TGT = "${SYSTEMD_DEFAULT_TARGET}"
+BLETCHLEY_SYS_ST_INIT_INSTFMT="../bletchley-system-state-init@.service:${TGT}.wants/bletchley-system-state-init@{0}.service"
+
+SYSTEMD_SERVICE:${PN} += "bletchley-system-state-init@.service"
+SYSTEMD_LINK:${PN} += "${@compose_list(d, 'BLETCHLEY_SYS_ST_INIT_INSTFMT', 'OBMC_HOST_INSTANCES')}"
\ No newline at end of file