diff options
author | Potin Lai <potin.lai@quantatw.com> | 2022-08-19 10:16:13 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2022-09-06 20:58:53 +0300 |
commit | e27ad3bfc333955ccbb77c5447ae207df007ccf0 (patch) | |
tree | 6688c48b25a5d339819c3972cb5b09341b70ed7b | |
parent | aafe18780bb86f76d2a79301775bb20b7d2eb151 (diff) | |
download | openbmc-e27ad3bfc333955ccbb77c5447ae207df007ccf0.tar.xz |
meta-bletchley: motor-ctrl: map host power action to obmc host target
Mapping AC relay on/off to chassis power on/off:
- host-ac-on@.service --> obmc-chassis-poweron@.target
- host-ac-off@.service --> obmc-chassis-poweroff@.target
Mapping host power button on/off to host starting/stopping
- host-poweron@.service --> obmc-host-starting@.target
- host-poweroff@.service --> obmc-host-stopping@.target
Test Results:
root@bletchley:~# obmcutil -i=6 poweron
root@bletchley:~# obmcutil -i=6 state
CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Ready
CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.On
CurrentHostState : xyz.openbmc_project.State.Host.HostState.Running
BootProgress : xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified
OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive
root@bletchley:~# obmcutil -i=6 poweroff
root@bletchley:~# obmcutil -i=6 state
CurrentBMCState : xyz.openbmc_project.State.BMC.BMCState.Ready
CurrentPowerState : xyz.openbmc_project.State.Chassis.PowerState.Off
CurrentHostState : xyz.openbmc_project.State.Host.HostState.Off
BootProgress : xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified
OperatingSystemState: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I1fa2ec6d9233be61117149ac7f7d46f0417a6930
-rw-r--r-- | meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-off@.service | 1 | ||||
-rw-r--r-- | meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb | 9 |
2 files changed, 5 insertions, 5 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 index e65911fef8..6b42f8f067 100644 --- 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 @@ -1,6 +1,7 @@ [Unit] Description=Turn off AC at Sled%i Conflicts=host-ac-on@%i.service +After=host-poweroff@%i.service [Service] Type=oneshot 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 feab224262..1b9f75e893 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 @@ -29,12 +29,12 @@ do_install() { TGT = "${SYSTEMD_DEFAULT_TARGET}" MOTOR_INIT_INSTFMT="../motor-init-calibration@.service:${TGT}.wants/motor-init-calibration@{0}.service" -PWR_ON_INSTFMT="../host-poweron@.service:obmc-host-startmin@{0}.target.wants/host-poweron@{0}.service" -PWR_OFF_INSTFMT="../host-poweroff@.service:obmc-host-shutdown@{0}.target.wants/host-poweroff@{0}.service" +PWR_ON_INSTFMT="../host-poweron@.service:obmc-host-starting@{0}.target.wants/host-poweron@{0}.service" +PWR_OFF_INSTFMT="../host-poweroff@.service:obmc-host-stopping@{0}.target.wants/host-poweroff@{0}.service" PWR_RESET_INSTFMT="host-reset@.service:host-reset@{0}.service" PWR_CYCLE_INSTFMT="host-cycle@.service:host-cycle@{0}.service" -AC_ON_INSTFMT="../host-ac-on@.service:${TGT}.wants/host-ac-on@{0}.service" -AC_OFF_INSTFMT="host-ac-off@.service:host-ac-off@{0}.service" +AC_ON_INSTFMT="../host-ac-on@.service:obmc-chassis-poweron@{0}.target.requires/host-ac-on@{0}.service" +AC_OFF_INSTFMT="../host-ac-off@.service:obmc-chassis-poweroff@{0}.target.requires/host-ac-off@{0}.service" SYSTEMD_SERVICE:${PN} += "motor-init-calibration@.service" SYSTEMD_LINK:${PN} += "${@compose_list(d, 'MOTOR_INIT_INSTFMT', 'OBMC_HOST_INSTANCES')}" @@ -85,4 +85,3 @@ SYSTEMD_OVERRIDE:${PN}:bletchley += "${@compose_list_zip(d, 'HOST_ON_OVERRIDE_CO # Host off unit configurations HOST_OFF_OVERRIDE_CONF_FMT = "host-poweroff.conf:host-poweroff@{0}.service.d/host-poweroff.conf" SYSTEMD_OVERRIDE:${PN}:bletchley += "${@compose_list_zip(d, 'HOST_OFF_OVERRIDE_CONF_FMT', 'OBMC_HOST_INSTANCES')}" - |