summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-off@.service7
-rw-r--r--meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-on@.service11
-rw-r--r--meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb8
3 files changed, 26 insertions, 0 deletions
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-off@.service b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-off@.service
new file mode 100644
index 0000000000..396261314b
--- /dev/null
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-off@.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Turn off AC at Sled%i
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/power-ctrl sled%i ac-off
+SyslogIdentifier=power-ctrl
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-on@.service b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-on@.service
new file mode 100644
index 0000000000..69d604261d
--- /dev/null
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-on@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Turn on AC at Sled%i
+After=motor-init-calibration@%i.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/power-ctrl sled%i ac-on
+SyslogIdentifier=power-ctrl
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb
index 2705eb850f..fac0cd421b 100644
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb
@@ -26,6 +26,8 @@ do_install() {
MOTOR_INIT_INSTFMT= "motor-init-calibration@{0}.service"
PWR_ON_INSTFMT="host-poweron@.service:host-poweron@{0}.service"
PWR_OFF_INSTFMT="host-poweroff@.service:host-poweroff@{0}.service"
+AC_ON_INSTFMT="host-ac-on@{0}.service"
+AC_OFF_INSTFMT="host-ac-off@.service:host-ac-off@{0}.service"
SYSTEMD_SERVICE:${PN} ="${@compose_list(d, 'MOTOR_INIT_INSTFMT', 'OBMC_HOST_INSTANCES')}"
FILES:${PN} += "${systemd_system_unitdir}/motor-init-calibration@.service"
@@ -35,3 +37,9 @@ SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PWR_ON_INSTFMT', 'OBMC_HOST_INSTANCES
SYSTEMD_SERVICE:${PN} +="host-poweroff@.service"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PWR_OFF_INSTFMT', 'OBMC_HOST_INSTANCES')}"
+
+SYSTEMD_SERVICE:${PN} +="${@compose_list(d, 'AC_ON_INSTFMT', 'OBMC_HOST_INSTANCES')}"
+FILES:${PN} += "${systemd_system_unitdir}/host-ac-#@.service"
+
+SYSTEMD_SERVICE:${PN} +="host-ac-off@.service"
+SYSTEMD_LINK:${PN} += "${@compose_list(d, 'AC_OFF_INSTFMT', 'OBMC_HOST_INSTANCES')}"