From 390901315e9a710fba42b20a4287d7e67d3fedb1 Mon Sep 17 00:00:00 2001 From: George Hung Date: Tue, 12 May 2020 16:56:27 +0800 Subject: meta-quanta: gbs: add Hotswap Power Cycle Service Add a hotswap power cycle service for oem google sys command, "Delay hard reset". Tested: Setting 5 secs delay for delay hard reset: ~# ipmitool raw 0x2e 0x32 0x79 0x2b 0x00 0x05 0x00 0x00 0x00 79 2b 00 03 (From meta-quanta rev: 4f20ff8ff1a9ea91f0e2a4f55ec7a2525bfc8a9a) Signed-off-by: George Hung Change-Id: Ib114ba2c47d652cb9c9999b45b503698e7fc5207 Signed-off-by: Andrew Geissler --- .../files/hotswap-power-cycle.service | 14 ++++++++++++++ .../hotswap-power-cycle/gbs-hotswap-power-cycle.bb | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/hotswap-power-cycle.service create mode 100644 meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/gbs-hotswap-power-cycle.bb (limited to 'meta-quanta') diff --git a/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/hotswap-power-cycle.service b/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/hotswap-power-cycle.service new file mode 100644 index 000000000..57724f353 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/hotswap-power-cycle.service @@ -0,0 +1,14 @@ +[Unit] +Description=Power Cycle by Hotswap Controller + +[Service] +EnvironmentFile=/run/psu_timedelay +ExecStartPre=sleep $PSU_HARDRESET_DELAY +ExecStart=gpioset gpiochip6 26=1 +Restart=no +Type=oneshot +RemainAfterExit=true +StandardOutput=syslog + +[Install] +WantedBy=gbmc-psu-hardreset.target diff --git a/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/gbs-hotswap-power-cycle.bb b/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/gbs-hotswap-power-cycle.bb new file mode 100644 index 000000000..1a20beec7 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/gbs-hotswap-power-cycle.bb @@ -0,0 +1,21 @@ +SUMMARY = "Power Cycle by Hotswap Controller" +DESCRIPTION = "Power Cycle by Hotswap Controller Daemon" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit systemd + +DEPENDS += "systemd" +RDEPENDS_${PN} += "bash" + +SRC_URI = " file://hotswap-power-cycle.service" + +do_install() { + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/hotswap-power-cycle.service ${D}${systemd_system_unitdir} +} + +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE_${PN} = "hotswap-power-cycle.service" + -- cgit v1.2.3