Install blackout target to led-manager
Installs the led-service to the newly added 'obmc-chassis-blackout@
.target'. When a system suffers from a power blackout the power-leds
may still be asserted to signify that they are on.
This change ensures that obmc-led-group-stop@power_on.service
is ran when a blackout is detected so that all led's are
de-asserted.
Tested:
- Confirmed that the service was installed to the target
root@p10bmc:/lib/systemd/system/obmc-chassis-blackout@0.target.wants# ls
obmc-led-group-stop@power_on.service
phosphor-reset-sensor-states@0.service
- Verified that obmc-led-group-start@power_on.service
was stopped when obmc-chassis-blackout@0.target is
hit.
root@p10bmc: systemctl start obmc-chassis-blackout@0.target
Jul 22 20:48:14 p10bmc systemd[1]:
obmc-led-group-start@power_on.service:Deactivated successfully.
Jul 22 20:48:14 p10bmc systemd[1]: Stopped Assert power_on LED
root@p10bmc:~# systemctl status obmc-led-group-stop@power_on.service
* obmc-led-group-stop@power_on.service - Assert power_on LED
Loaded: loaded (/lib/systemd/system/obmc-led-group-stop@.service; static)
Active: active (exited) since Fri 2022-07-22 20:48:14 UTC; 37s ago
Signed-off-by: Corey Hardesty <corey.hardesty@icloud.com>
Change-Id: Iec51e970b07ed331cff32c6e26c6f869167291dc
diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager_git.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager_git.bb
index c481aa5..b2cf9f7 100644
--- a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager_git.bb
+++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager_git.bb
@@ -54,6 +54,12 @@
FMT = "../${TMPLFMT}:${TGTFMT}.wants/${INSTFMT}"
SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'FMT', 'CHASSIS_TARGETS', 'STATES')}"
+CHASSIS_BLACKOUT_TGT = "obmc-chassis-blackout@{0}.target"
+LED_STOP_SVC = "obmc-led-group-stop@.service"
+LED_POWER_STOP_SVC = "obmc-led-group-stop@power_on.service"
+CHASSIS_LED_BLACKOUT_FMT = "../${LED_STOP_SVC}:${CHASSIS_BLACKOUT_TGT}.wants/${LED_POWER_STOP_SVC}"
+SYSTEMD_LINK:${PN} += "${@compose_list(d, 'CHASSIS_LED_BLACKOUT_FMT', 'OBMC_CHASSIS_INSTANCES' )}"
+
# Install the override to set up a Conflicts relation
SYSTEMD_OVERRIDE:${PN} += "bmc_booted.conf:obmc-led-group-start@bmc_booted.service.d/bmc_booted.conf"