meta-facebook: greatlakes: initial phopsphor-state-manager support

Added machine layer support for greatlakes to support control the
BMC, Chassis, and Host.  It supports requests to power on and off
the system by the user.

Signed-off-by: Karthikeyan Pasupathi <pkarthikeyan1509@gmail.com>
Change-Id: Ie62cc289783d47d8b50cd0c555157749f160c253
diff --git a/meta-facebook/recipes-phosphor/state/phosphor-state-manager_%.bbappend b/meta-facebook/recipes-phosphor/state/phosphor-state-manager_%.bbappend
new file mode 100644
index 0000000..77f4be7
--- /dev/null
+++ b/meta-facebook/recipes-phosphor/state/phosphor-state-manager_%.bbappend
@@ -0,0 +1,40 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+DEFAULT_TARGETS = " \
+    multi-user.target.requires/obmc-host-reset@{}.target \
+    obmc-chassis-poweron@{}.target.wants/chassis-poweron@{}.service \
+    obmc-chassis-hard-poweroff@{}.target.wants/chassis-poweroff@{}.service \
+    obmc-host-shutdown@{}.target.wants/host-poweroff@{}.service \
+    obmc-host-start@{}.target.wants/host-poweron@{}.service \
+    obmc-host-reboot@{}.target.wants/host-powercycle@{}.service \
+"
+
+SRC_URI:append:greatlakes = " \
+    file://chassis-poweroff@.service \
+    file://chassis-poweron@.service \
+    file://host-poweroff@.service \
+    file://host-poweron@.service \
+    file://host-powercycle@.service \
+    file://chassis-poweroff \
+    file://chassis-poweron \
+    file://host-poweroff \
+    file://host-poweron \
+    file://host-powercycle \
+    file://power-cmd \
+    "
+
+RDEPENDS:${PN}:append:greatlakes = " bash"
+
+do_install:append:greatlakes() {
+    install -d ${D}${systemd_system_unitdir}
+    install -m 0644 ${WORKDIR}/*.service ${D}${systemd_system_unitdir}/
+
+    install -d ${D}${libexecdir}
+    install -m 0777 ${WORKDIR}/chassis-poweroff ${D}${libexecdir}/
+    install -m 0777 ${WORKDIR}/chassis-poweron ${D}${libexecdir}/
+    install -m 0777 ${WORKDIR}/host-poweroff ${D}${libexecdir}/
+    install -m 0777 ${WORKDIR}/host-poweron ${D}${libexecdir}/
+    install -m 0777 ${WORKDIR}/host-powercycle ${D}${libexecdir}/
+    install -m 0777 ${WORKDIR}/power-cmd ${D}${libexecdir}/
+}
+FILES:${PN} += " /lib/systemd/system/*.service"