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/files/bletchley-system-state-init@.service b/meta-facebook/meta-bletchley/recipes-bletchley/plat-tools/files/bletchley-system-state-init@.service
new file mode 100644
index 0000000..0c98209
--- /dev/null
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/plat-tools/files/bletchley-system-state-init@.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Bletchley host state and chassis power state initialize for sled%i
+Wants=mapper-wait@-xyz-openbmc_project-state-chassis%i.service
+After=mapper-wait@-xyz-openbmc_project-state-chassis%i.service
+Wants=mapper-wait@-xyz-openbmc_project-state-host%i.service
+After=mapper-wait@-xyz-openbmc_project-state-host%i.service
+
+[Service]
+ExecStart=/usr/libexec/bletchley-system-state-init %i
+SyslogIdentifier=bletchley-system-state-init sled%i
+Type=oneshot
+RemainAfterExit=yes
+Restart=on-failure
+RestartSec=1
+
+[Install]
+WantedBy=multi-user.target