Add wrapper script to setup delay powercycle
This script allow us to have a common way to setup the delay powercycle
without going through the ipmi command if needed.
Change-Id: Ida63f066551404b900f5e64e3a150f886b7e6b7c
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/gbmc-enqueue-powercycle.sh b/gbmc-enqueue-powercycle.sh
new file mode 100644
index 0000000..80fdc43
--- /dev/null
+++ b/gbmc-enqueue-powercycle.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+echo "${1}" > "/run/psu_timedelay"
+systemctl start gbmc-psu-hardreset.target --no-block
diff --git a/meson.build b/meson.build
index 62be177..ca7cb1b 100644
--- a/meson.build
+++ b/meson.build
@@ -99,3 +99,9 @@
'gbmc-psu-hardreset-time.service',
install_dir: systemd_dep.get_variable('systemdsystemunitdir'))
endif
+
+install_data(
+ 'gbmc-enqueue-powercycle.sh',
+ install_dir: get_option('bindir'),
+ install_mode: 'rwxr-xr-x'
+)