summaryrefslogtreecommitdiff
path: root/meta-quanta
diff options
context:
space:
mode:
authorJoseph Fu <joseph.fu@quantatw.com>2022-02-18 11:20:17 +0300
committerJoseph Fu <joseph.fu@quantatw.com>2022-02-24 05:20:37 +0300
commit23e5d9b86c7ee816d87ded9c05385da4b96192bf (patch)
tree2f292c695c6144b75588f42e4707fb709fa55875 /meta-quanta
parent26d53c5faa5cb22d02371ca8225ae8cdcfbf159a (diff)
downloadopenbmc-23e5d9b86c7ee816d87ded9c05385da4b96192bf.tar.xz
meta-quanta: s6q: add watchdog service
Add service files to enable ipmitool watchdog command. Tested: 1.setting watchdog action hard reset ~# ipmitool raw 0x06 0x24 0x01 0x01 0x01 0x02 0x64 0x00 starting reset ~# ipmitool raw 0x06 0x22 2.power off ~# ipmitool raw 0x06 0x24 0x01 0x02 0x01 0x02 0x64 0x00 ~# ipmitool raw 0x06 0x22 3.power cycle ~# ipmitool raw 0x06 0x24 0x01 0x02 0x01 0x02 0x64 0x00 ~# ipmitool raw 0x06 0x22 Use these commands to verify the result matches service settings. Signed-off-by: Joseph Fu <joseph.fu@quantatw.com> Change-Id: I738d0d86b6a9729d488f22e841e207aaab219796
Diffstat (limited to 'meta-quanta')
-rw-r--r--meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-powercycle.service9
-rw-r--r--meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service8
-rw-r--r--meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service9
-rw-r--r--meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service16
-rw-r--r--meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend8
-rw-r--r--meta-quanta/meta-s6q/recipes-s6q/packagegroups/packagegroup-s6q-apps.bb1
6 files changed, 51 insertions, 0 deletions
diff --git a/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-powercycle.service b/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-powercycle.service
new file mode 100644
index 0000000000..9b8b0d6913
--- /dev/null
+++ b/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-powercycle.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Power Cycle Host Server
+After=xyz.openbmc_project.Chassis.Control.Power.service
+
+[Service]
+Type=oneshot
+ExecStart=busctl set-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis RequestedPowerTransition s xyz.openbmc_project.State.Chassis.Transition.PowerCycle
+ExecStart=busctl set-property xyz.openbmc_project.Control.Host.RestartCause /xyz/openbmc_project/control/host0/restart_cause xyz.openbmc_project.Control.Host.RestartCause RequestedRestartCause s xyz.openbmc_project.State.Host.RestartCause.WatchdogTimer
+SyslogIdentifier=phosphor-watchdog
diff --git a/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service b/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service
new file mode 100644
index 0000000000..af7e6ef0da
--- /dev/null
+++ b/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Shutdown Host Server
+After=xyz.openbmc_project.Chassis.Control.Power.service
+
+[Service]
+Type=oneshot
+ExecStart=busctl set-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis RequestedPowerTransition s xyz.openbmc_project.State.Chassis.Transition.Off
+SyslogIdentifier=phosphor-watchdog
diff --git a/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service b/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service
new file mode 100644
index 0000000000..655618b057
--- /dev/null
+++ b/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Reset Host Server
+After=xyz.openbmc_project.Chassis.Control.Power.service
+
+[Service]
+Type=oneshot
+ExecStart=busctl set-property xyz.openbmc_project.State.Host /xyz/openbmc_project/state/host0 xyz.openbmc_project.State.Host RequestedHostTransition s xyz.openbmc_project.State.Host.Transition.ForceWarmReboot
+ExecStart=busctl set-property xyz.openbmc_project.Control.Host.RestartCause /xyz/openbmc_project/control/host0/restart_cause xyz.openbmc_project.Control.Host.RestartCause RequestedRestartCause s xyz.openbmc_project.State.Host.RestartCause.WatchdogTimer
+SyslogIdentifier=phosphor-watchdog
diff --git a/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service b/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service
new file mode 100644
index 0000000000..bccd41cd10
--- /dev/null
+++ b/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Phosphor Watchdog
+
+[Service]
+ExecStart=/usr/bin/env phosphor-watchdog --continue --service=xyz.openbmc_project.Watchdog \
+ --path=/xyz/openbmc_project/watchdog/host0 \
+ --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=phosphor-watchdog-host-reset.service \
+ --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=phosphor-watchdog-host-poweroff.service \
+ --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=phosphor-watchdog-host-powercycle.service \
+
+SyslogIdentifier=phosphor-watchdog
+BusName=xyz.openbmc_project.Watchdog
+Type=dbus
+
+[Install]
+WantedBy=basic.target
diff --git a/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend b/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend
new file mode 100644
index 0000000000..4c2fe7d5dd
--- /dev/null
+++ b/meta-quanta/meta-s6q/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend
@@ -0,0 +1,8 @@
+FILESEXTRAPATHS:prepend:s6q := ":${THISDIR}/${PN}"
+
+SYSTEMD_OVERRIDE:${PN}:remove:s6q = "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf"
+SYSTEMD_SERVICE:${PN}:s6q = " phosphor-watchdog.service \
+ phosphor-watchdog-host-reset.service \
+ phosphor-watchdog-host-poweroff.service \
+ phosphor-watchdog-host-powercycle.service \
+ "
diff --git a/meta-quanta/meta-s6q/recipes-s6q/packagegroups/packagegroup-s6q-apps.bb b/meta-quanta/meta-s6q/recipes-s6q/packagegroups/packagegroup-s6q-apps.bb
index 70b5ef7808..39eb33a00e 100644
--- a/meta-quanta/meta-s6q/recipes-s6q/packagegroups/packagegroup-s6q-apps.bb
+++ b/meta-quanta/meta-s6q/recipes-s6q/packagegroups/packagegroup-s6q-apps.bb
@@ -45,4 +45,5 @@ RDEPENDS:${PN}-system = " \
ipmitool \
phosphor-post-code-manager \
phosphor-host-postd \
+ phosphor-watchdog \
"