summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2020-10-23 10:10:20 +0300
committerAndrew Geissler <geissonator@yahoo.com>2020-12-15 21:53:48 +0300
commit1a8345b34bb88a212c75d8188d5385ccbc6c2a3e (patch)
treec5565c45fd6a1793d8c201dc25499caeba2380d8
parent530e1d809b87f0646b8131540d57a985b0aca527 (diff)
downloadopenbmc-1a8345b34bb88a212c75d8188d5385ccbc6c2a3e.tar.xz
LEDS: Add systemd unit to call led-set-all-groups-asserted.sh
led-set-all-groups-asserted.sh needs to be called with "false" as part of below transitions to turn off all indicator LEDs - BMC booting to standby and staying at standby - BMC starting to power on (From meta-ibm rev: e784b71c2d625b4507758df4bb5743fc678251f3) Change-Id: If248220964c65e91e9382504b1a7095cc5cec26b Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
-rw-r--r--meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc-led-set-all-groups-asserted@.service13
-rw-r--r--meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc/led/set-all/groups/config1
-rw-r--r--meta-ibm/recipes-phosphor/leds/phosphor-led-manager_%.bbappend30
3 files changed, 44 insertions, 0 deletions
diff --git a/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc-led-set-all-groups-asserted@.service b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc-led-set-all-groups-asserted@.service
new file mode 100644
index 000000000..82763ea20
--- /dev/null
+++ b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc-led-set-all-groups-asserted@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Set the Asserted property of all the LED groups to %i
+Wants=xyz.openbmc_project.LED.GroupManager
+After=xyz.openbmc_project.LED.GroupManager
+After=op-reset-chassis-running@0.service
+ConditionPathExists=!/run/openbmc/chassis@0-on
+
+[Service]
+Type=oneshot
+Restart=no
+EnvironmentFile={envfiledir}/obmc/led/set-all/groups/config
+ExecStart=/bin/bash -c "led-set-all-groups-asserted.sh %i ${{EXCLUDED_GROUPS}}"
+SyslogIdentifier=obmc-led-set-all-groups-asserted
diff --git a/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc/led/set-all/groups/config b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc/led/set-all/groups/config
new file mode 100644
index 000000000..664200dca
--- /dev/null
+++ b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc/led/set-all/groups/config
@@ -0,0 +1 @@
+EXCLUDED_GROUPS=bmc_booted power_on
diff --git a/meta-ibm/recipes-phosphor/leds/phosphor-led-manager_%.bbappend b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager_%.bbappend
new file mode 100644
index 000000000..612139550
--- /dev/null
+++ b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager_%.bbappend
@@ -0,0 +1,30 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SYSTEMD_SERVICE_${PN}-ledmanager_append_rainier += "obmc-led-set-all-groups-asserted@.service"
+
+# Copies config file having arguments for led-set-all-groups-asserted.sh
+SYSTEMD_ENVIRONMENT_FILE_${PN}-ledmanager_append_rainier +="obmc/led/set-all/groups/config"
+
+pkg_postinst_${PN}-ledmanager_rainier () {
+
+ # Needed this to run as part of BMC boot
+ mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
+ LINK="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-set-all-groups-asserted@false.service"
+ TARGET="../obmc-led-set-all-groups-asserted@.service"
+ ln -s $TARGET $LINK
+
+ # Needed this to run as part of Power On
+ mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants
+ LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-led-set-all-groups-asserted@false.service"
+ TARGET="../obmc-led-set-all-groups-asserted@.service"
+ ln -s $TARGET $LINK
+}
+
+pkg_prerm_${PN}-ledmanager_rainier () {
+
+ LINK="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-set-all-groups-asserted@false.service"
+ rm $LINK
+
+ LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-led-set-all-groups-asserted@false.service"
+ rm $LINK
+}