diff options
author | Andrew Geissler <geissonator@yahoo.com> | 2022-11-11 23:00:30 +0300 |
---|---|---|
committer | Andrew Geissler <andrew@geissonator.com> | 2022-11-28 21:20:11 +0300 |
commit | b5138ed3b10678b7b50a7da888f98dfbe3fec496 (patch) | |
tree | 93f17ab1783e2597ee8ffeb9acd96ad30540f01a /meta-phosphor/recipes-phosphor | |
parent | cba505a2e686ef67aa8ce0b2f73a200dfddcf85c (diff) | |
download | openbmc-b5138ed3b10678b7b50a7da888f98dfbe3fec496.tar.xz |
move generic chassis services into phosphor-state-manager
Move the generic services which are used to power on and off the chassis
into phosphor-state-manager. This will make the use of
phosphor-state-manager for chassis power control more straightforward.
The following email has more details on this change:
https://lists.ozlabs.org/pipermail/openbmc/2022-November/032457.html
phosphor-state-manager: srcrev bump eab2ea348d..69a250dd45
Andrew Geissler (2):
move chassis power services to phosphor-state-manager
improve new chassis power services
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I14fce315107cafacb0500d8664e51d9f61f7864d
Diffstat (limited to 'meta-phosphor/recipes-phosphor')
8 files changed, 12 insertions, 121 deletions
diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service deleted file mode 100644 index 82b7938667..0000000000 --- a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service +++ /dev/null @@ -1,20 +0,0 @@ -[Unit] -Description=Start Power%i -Wants=obmc-power-start@%i.target -Before=obmc-power-start@%i.target -Wants=obmc-power-start-pre@%i.target -After=obmc-power-start-pre@%i.target -After=obmc-fan-control.target -Wants=mapper-wait@-org-openbmc-control-power%i.service -After=mapper-wait@-org-openbmc-control-power%i.service -Conflicts=obmc-chassis-poweroff@%i.target -ConditionPathExists=!/run/openbmc/chassis@%i-on - -[Service] -RemainAfterExit=yes -Type=oneshot -ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/power%i` /org/openbmc/control/power%i org.openbmc.control.Power setPowerState i 1" -SyslogIdentifier=op-power-start - -[Install] -WantedBy=obmc-host-start@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-stop@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-stop@.service deleted file mode 100644 index 40dbf36377..0000000000 --- a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-stop@.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Stop Power%i -Wants=obmc-power-stop@%i.target -Before=obmc-power-stop@%i.target -Wants=obmc-power-stop-pre@%i.target -After=obmc-power-stop-pre@%i.target -Wants=mapper-wait@-org-openbmc-control-power%i.service -After=mapper-wait@-org-openbmc-control-power%i.service -Conflicts=obmc-chassis-poweron@%i.target - -[Service] -RemainAfterExit=yes -ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/power%i` /org/openbmc/control/power%i org.openbmc.control.Power setPowerState i 0" -SyslogIdentifier=op-power-stop - -[Install] -WantedBy=obmc-host-stop@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-powered-off@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-powered-off@.service deleted file mode 100644 index b76db7bf41..0000000000 --- a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-powered-off@.service +++ /dev/null @@ -1,20 +0,0 @@ -[Unit] -Description=Power is off to chassis%i -After=op-wait-power-off@%i.service -Requires=op-wait-power-off@%i.service - -[Service] -RemainAfterExit=no -# systemd starts all wanted targets in parallel and a Conflict -# statement will resolve itself when the target starts, not when -# completes. Some services have a requirement to stop -# once power is off. The solution is to create a new target, -# obmc-chassis-powered-off@.target, that is started after it is -# verified that power has been removed from the chassis. Then -# services may conflict with this target to ensure they -# are stopped at the appropriate time. -ExecStart=/bin/systemctl start obmc-chassis-powered-off@%i.target - - -[Install] -WantedBy=obmc-chassis-poweroff@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service deleted file mode 100644 index f2a7103254..0000000000 --- a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Start chassis%i on after BMC reset -Requires=op-reset-chassis-running@%i.service -After=op-reset-chassis-running@%i.service -After=obmc-power-reset-on@%i.target -Requires=obmc-power-reset-on@%i.target -ConditionPathExists=/run/openbmc/chassis@%i-on - -[Service] -RemainAfterExit=no -ExecStart=/bin/systemctl start obmc-chassis-poweron@%i.target - - -[Install] -WantedBy=obmc-chassis-powerreset@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-running@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-running@.service deleted file mode 100644 index 381f89dfca..0000000000 --- a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-running@.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Check Chassis%i pgood and create a file to indicate it -Wants=mapper-wait@-org-openbmc-control-power%i.service -After=mapper-wait@-org-openbmc-control-power%i.service -Wants=obmc-power-reset-on@%i.target -Before=obmc-power-reset-on@%i.target -Conflicts=obmc-chassis-poweroff@%i.target - -[Service] -RemainAfterExit=no -Type=oneshot -ExecStart=/bin/sh -c "if [ $(busctl get-property `mapper get-service /org/openbmc/control/power%i` /org/openbmc/control/power%i org.openbmc.control.Power pgood | sed 's/i\s*[1]/on/' | grep on | wc -l) != 0 ]; then mkdir -p /run/openbmc/ && touch /run/openbmc/chassis@%i-on; fi" - -[Install] -WantedBy=obmc-chassis-powerreset@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power_git.bb b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power_git.bb index 1a65a11b67..4ccff7b500 100644 --- a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power_git.bb +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power_git.bb @@ -15,57 +15,25 @@ OBMC_CONTROL_POWER_FMT ?= "org.openbmc.control.Power@{0}.service" DBUS_SERVICE:${PN} += "${@compose_list(d, 'OBMC_CONTROL_POWER_FMT', 'OBMC_POWER_INSTANCES')}" SYSTEMD_SERVICE:${PN} += " \ - op-power-start@.service \ op-wait-power-on@.service \ - op-power-stop@.service \ op-wait-power-off@.service \ - op-reset-chassis-running@.service \ - op-reset-chassis-on@.service \ - op-powered-off@.service \ " SYSTEMD_ENVIRONMENT_FILE:${PN} += "obmc/power_control" -START_TMPL = "op-power-start@.service" START_TGTFMT = "obmc-chassis-poweron@{1}.target" -START_INSTFMT = "op-power-start@{0}.service" -START_FMT = "../${START_TMPL}:${START_TGTFMT}.requires/${START_INSTFMT}" - -STOP_TMPL = "op-power-stop@.service" -STOP_TGTFMT = "obmc-chassis-poweroff@{1}.target" -STOP_INSTFMT = "op-power-stop@{0}.service" -STOP_FMT = "../${STOP_TMPL}:${STOP_TGTFMT}.requires/${STOP_INSTFMT}" - -POWERED_OFF_TMPL = "op-powered-off@.service" -POWERED_OFF_INSTFMT = "op-powered-off@{0}.service" -POWERED_OFF_FMT = "../${POWERED_OFF_TMPL}:${STOP_TGTFMT}.requires/${POWERED_OFF_INSTFMT}" - ON_TMPL = "op-wait-power-on@.service" ON_INSTFMT = "op-wait-power-on@{0}.service" ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}" +STOP_TGTFMT = "obmc-chassis-poweroff@{1}.target" OFF_TMPL = "op-wait-power-off@.service" OFF_INSTFMT = "op-wait-power-off@{0}.service" OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}" -RESET_TGTFMT = "obmc-chassis-powerreset@{1}.target" - -RESET_ON_TMPL = "op-reset-chassis-running@.service" -RESET_ON_INSTFMT = "op-reset-chassis-running@{0}.service" -RESET_ON_FMT = "../${RESET_ON_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_INSTFMT}" - -RESET_ON_CHASSIS_TMPL = "op-reset-chassis-on@.service" -RESET_ON_CHASSIS_INSTFMT = "op-reset-chassis-on@{0}.service" -RESET_ON_CHASSIS_FMT = "../${RESET_ON_CHASSIS_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_CHASSIS_INSTFMT}" - # Build up requires relationship for START_TGTFMT and STOP_TGTFMT -SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" -SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" -SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'POWERED_OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" -SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'RESET_ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" -SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'RESET_ON_CHASSIS_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" # Now show that the main control target requires these power targets START_TMPL_CTRL = "obmc-chassis-poweron@.target" diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc index 2a5bfda50f..ab1dab5f07 100644 --- a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc +++ b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc @@ -2,6 +2,9 @@ DEFAULT_TARGETS = " \ multi-user.target.requires/obmc-host-reset@{}.target \ multi-user.target.wants/phosphor-discover-system-state@{}.service \ obmc-chassis-poweron@{}.target.wants/phosphor-reset-host-recovery@{}.service \ + obmc-chassis-poweron@{}.target.requires/obmc-power-start@{}.service \ + obmc-chassis-poweroff@{}.target.requires/obmc-power-stop@{}.service \ + obmc-chassis-poweroff@{}.target.requires/obmc-powered-off@{}.service \ obmc-host-start@{}.target.requires/obmc-host-startmin@{}.target \ obmc-host-start@{}.target.requires/phosphor-reset-host-reboot-attempts@{}.service \ obmc-host-startmin@{}.target.wants/phosphor-set-host-transition-to-running@{}.service \ @@ -20,6 +23,8 @@ DEFAULT_TARGETS = " \ obmc-host-warm-reboot@{}.target.requires/obmc-host-force-warm-reboot@{}.target \ obmc-chassis-poweroff@{}.target.wants/phosphor-clear-one-time@{}.service \ obmc-chassis-blackout@{}.target.wants/phosphor-reset-sensor-states@{}.service \ + obmc-chassis-powerreset@{}.target.requires/obmc-reset-chassis-on@{}.service \ + obmc-chassis-powerreset@{}.target.requires/obmc-reset-chassis-running@{}.service \ " # TODO: There are some targets that are chassis oriented, but there is no diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb index f6b7a76326..0b993610f0 100644 --- a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb +++ b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb @@ -74,6 +74,11 @@ SYSTEMD_SERVICE:${PN}-host += "phosphor-set-host-transition-to-off@.service" FILES:${PN}-chassis = "${bindir}/phosphor-chassis-state-manager" DBUS_SERVICE:${PN}-chassis += "xyz.openbmc_project.State.Chassis@.service" +SYSTEMD_SERVICE:${PN}-chassis += "obmc-power-start@.service" +SYSTEMD_SERVICE:${PN}-chassis += "obmc-power-stop@.service" +SYSTEMD_SERVICE:${PN}-chassis += "obmc-powered-off@.service" +SYSTEMD_SERVICE:${PN}-chassis += "phosphor-reset-chassis-on@.service" +SYSTEMD_SERVICE:${PN}-chassis += "phosphor-reset-chassis-running@.service" FILES:${PN}-chassis += "${bindir}/obmcutil" @@ -201,6 +206,6 @@ SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list(d, 'QUIESCE_FMT', 'HOST_ERRO SRC_URI += "git://github.com/openbmc/phosphor-state-manager;branch=master;protocol=https" -SRCREV = "eab2ea348d0a2a1b444b6a2c3c4814f277db9870" +SRCREV = "69a250dd4504c53449bb5136435fddbc168edd1c" S = "${WORKDIR}/git" |