diff options
author | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2021-03-26 21:01:30 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2021-03-30 18:17:11 +0300 |
commit | da5117af41a23e05b912fed1008503b09a361feb (patch) | |
tree | dd1911ad3ca261c4e74b9543d96c1738a654b488 /meta-ibm/recipes-phosphor | |
parent | d0bec79a3360bc5c9c2225bd44a9b3071709cdb9 (diff) | |
download | openbmc-da5117af41a23e05b912fed1008503b09a361feb.tar.xz |
leds: rainier: Create virtual physical LEDs
These virtual physical LEDs are a mirror of real enclosure fault
and enclosure Identify physical LEDs. However, these virtual LEDs
are needed to be able to communicate the effective state of the
enclosure fault and enclosure identify LEDs during lamp test.
During lamp test, real physical enclosure fault and enclosure id
LEDs should not be updated and they must be updated only after
the lamp test finishes. However, Hypervisors would need to know
the effective state of enclosure level fault and identify
LEDs and that problem is resolved by these virtual LEDs.
Once the lamp test finishes, these virtual physical LEDs would again
be in sync with real enclosure fault and Identify LEDs.
Tests:
root@bmc:/lib/systemd/system/multi-user.target.wants# busctl tree
xyz.openbmc_project.LED.Controller.virtual_enc_fault
└─/xyz
└─/xyz/openbmc_project
└─/xyz/openbmc_project/led
└─/xyz/openbmc_project/led/physical
└─/xyz/openbmc_project/led/physical/virtual_enc_fault
root@bmc:/lib/systemd/system/multi-user.target.wants# busctl tree
xyz.openbmc_project.LED.Controller.virtual_enc_id
└─/xyz
└─/xyz/openbmc_project
└─/xyz/openbmc_project/led
└─/xyz/openbmc_project/led/physical
└─/xyz/openbmc_project/led/physical/virtual_enc_id
root@bmc:/lib/systemd/system/multi-user.target.wants#
busctl get-property xyz.openbmc_project.LED.Controller.virtual_enc_fault
/xyz/openbmc_project/led/physical/virtual_enc_fault
xyz.openbmc_project.Led.Physical State
s "xyz.openbmc_project.Led.Physical.Action.Off"
root@bmc:/lib/systemd/system/multi-user.target.wants# busctl
set-property xyz.openbmc_project.LED.GroupManager
/xyz/openbmc_project/led/groups/ddimm0_identify xyz.openbmc_project.Led.Group
Asserted b true
root@bmc:/lib/systemd/system/multi-user.target.wants# busctl get-property
xyz.openbmc_project.LED.Controller.virtual_enc_id
/xyz/openbmc_project/led/physical/virtual_enc_id
xyz.openbmc_project.Led.Physical State
s "xyz.openbmc_project.Led.Physical.Action.On"
root@bmc:/lib/systemd/system/multi-user.target.wants# busctlset-property
xyz.openbmc_project.LED.GroupManager
/xyz/op_ebmc_project/led/groups/ddimm0_identify xyz.openbmc_project.Led.Group
Asserted b false
root@bmc:/lib/systemd/system/multi-user.target.wants# busctl get-property
xyz.openbmc_project.LED.Controller.virtual_enc_id
/xyz/openbmc_project/led/physical/virtual_enc_id
xyz.openbmc_project.Led.Physical State
s "xyz.openbmc_project.Led.Physical.Action.Off"
Change-Id: Ic0ee5b0f376911650d5489d8bb84a4e83247190f
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'meta-ibm/recipes-phosphor')
3 files changed, 45 insertions, 1 deletions
diff --git a/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/lamp-test-led-overrides.json b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/lamp-test-led-overrides.json new file mode 100644 index 000000000..0cde229ba --- /dev/null +++ b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/lamp-test-led-overrides.json @@ -0,0 +1,10 @@ +{ + "forceLEDs":[ + "virtual_enc_fault", + "virtual_enc_id" + ], + "skipLEDs":[ + "virtual_enc_fault", + "virtual_enc_id" + ] +} diff --git a/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc-led-create-virtual-leds@.service b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc-led-create-virtual-leds@.service new file mode 100644 index 000000000..41bd08131 --- /dev/null +++ b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager/obmc-led-create-virtual-leds@.service @@ -0,0 +1,7 @@ +[Unit] +Description=Create the virtual physical LEDs + +[Service] +Restart=always +ExecStart=/usr/sbin/phosphor-ledcontroller -p %f +SyslogIdentifier=obmc-led-create-virtual-leds diff --git a/meta-ibm/recipes-phosphor/leds/phosphor-led-manager_%.bbappend b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager_%.bbappend index 174d9d0a4..a41f12a34 100644 --- a/meta-ibm/recipes-phosphor/leds/phosphor-led-manager_%.bbappend +++ b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager_%.bbappend @@ -1,6 +1,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SYSTEMD_SERVICE_${PN}_append_rainier += "obmc-led-set-all-groups-asserted@.service" +SYSTEMD_SERVICE_${PN}_append_rainier += "obmc-led-set-all-groups-asserted@.service obmc-led-create-virtual-leds@.service" # Copies config file having arguments for led-set-all-groups-asserted.sh SYSTEMD_ENVIRONMENT_FILE_${PN}_append_rainier +="obmc/led/set-all/groups/config" @@ -9,6 +9,9 @@ SYSTEMD_ENVIRONMENT_FILE_${PN}_append_rainier +="obmc/led/set-all/groups/config" # Also, enable Lamp Test feature for rainier systems PACKAGECONFIG_append_rainier = " use-json use-lamp-test" +# Install the lamp test override file for rainier +SRC_URI_append_rainier = " file://lamp-test-led-overrides.json" + pkg_postinst_${PN}_rainier () { # Needed this to run as part of BMC boot @@ -22,6 +25,18 @@ pkg_postinst_${PN}_rainier () { 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 + + # Needed this to run as part of BMC boot + mkdir -p $D$systemd_system_unitdir/multi-user.target.wants + LINK_FAULT="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-fault.service" + TARGET_FAULT="../obmc-led-create-virtual-leds@.service" + ln -s $TARGET_FAULT $LINK_FAULT + + # Needed this to run as part of BMC boot + mkdir -p $D$systemd_system_unitdir/multi-user.target.wants + LINK_ID="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-id.service" + TARGET_ID="../obmc-led-create-virtual-leds@.service" + ln -s $TARGET_ID $LINK_ID } pkg_prerm_${PN}_rainier () { @@ -31,4 +46,16 @@ pkg_prerm_${PN}_rainier () { LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-led-set-all-groups-asserted@false.service" rm $LINK + + LINK_FAULT="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-fault.service" + rm $LINK_FAULT + + LINK_ID="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-id.service" + rm $LINK_ID +} + +# Install lamp test override json +do_install_append_rainier() { + install -d ${D}${datadir}/${BPN}/ + install -m 0644 ${WORKDIR}/lamp-test-led-overrides.json ${D}${datadir}/${BPN}/ } |