Skip to content

Commit

Permalink
LEDS: Add systemd unit to call clear-all-faults.sh
Browse files Browse the repository at this point in the history
clear-all-faults.sh needs to be called with "true"
  - List all the inventory D-Bus objects implementing
    xyz.openbmc_project.State.Decorator.OperationalStatus
  - For each of those : set Functional property to true

Call those as part of below transitions
- BMC booting to standby and staying at standby
- BMC starting to power on

Signed-off-by: Lakshminarayana R. Kammath <lkammath@in.ibm.com>
  • Loading branch information
lkammath committed Aug 30, 2021
1 parent c542721 commit 06a49d9
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Clears all fault LED to %i
Wants=xyz.openbmc_project.Inventory.Manager
After=xyz.openbmc_project.Inventory.Manager
After=op-reset-chassis-running@0.service
ConditionPathExists=!/run/openbmc/chassis@0-on

[Service]
Type=oneshot
Restart=no
EnvironmentFile={envfiledir}/obmc/led/clear-all/faults/config
ExecStart=/bin/bash -c "clear-all-faults.sh %i ${{EXCLUDED_GROUPS}}"
SyslogIdentifier=obmc-clear-all-faults

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EXCLUDED_GROUPS=bmc_booted power_on _fault
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,28 @@ SRC_URI:append:p10bmc = " \
file://ibm,everest_associations.json \
"

pkg_postinst:${PN}:p10bmc () {
# Needed this to run as part of BMC boot
mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
LINK_CLEAR="$D$systemd_system_unitdir/multi-user.target.wants/obmc-clear-all-faults@true.service"
TARGET_CLEAR="../obmc-clear-all-faults@.service"
ln -s $TARGET_CLEAR $LINK_CLEAR

# Needed this to run as part of Power On
mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants
LINK_CLEAR="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-clear-all-faults@true.service"
TARGET_CLEAR="../obmc-clear-all-faults@.service"
ln -s $TARGET_CLEAR $LINK_CLEAR
}

pkg_prerm:${PN}:p10bmc () {
LINK_CLEAR="$D$systemd_system_unitdir/multi-user.target.wants/obmc-clear-all-faults@true.service"
rm $LINK_CLEAR

LINK_CLEAR="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-clear-all-faults@true.service"
rm $LINK_CLEAR
}

do_install:append:ibm-ac-server() {
install -d ${D}${base_datadir}
install -m 0755 ${WORKDIR}/associations.json ${D}${base_datadir}/associations.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ DEPENDS += " \
${PYTHON_PN}-mako-native \
"

RDEPENDS_${PN} += "bash"

OBMC_INVENTORY_PATH="${OBMC_DBUS_PATH_ROOT}/inventory"
OBMC_INVENTORY_MGR_IFACE="${OBMC_DBUS_IFACE_ROOT}.Inventory.Manager"

Expand Down

0 comments on commit 06a49d9

Please sign in to comment.