Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LEDS: Add systemd unit to call clear-all-faults.sh #185

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Clears all fault LED to %i
After=obmc-chassis-powerreset@0.target
Wants=obmc-power-reset-on@0.target
After=obmc-power-reset-on@0.target
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-fault-leds.sh %i ${{EXCLUDED_GROUPS}}"
SyslogIdentifier=obmc-clear-all-fault-leds

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,33 @@ SRC_URI:append:p10bmc = " \
file://ibm,everest_associations.json \
"

SYSTEMD_SERVICE:${PN}:append:p10bmc += "obmc-clear-all-fault-leds@.service"

# Copies config file having arguments for clear-all-fault-leds.sh
SYSTEMD_ENVIRONMENT_FILE_${PN}:append:p10bmc +="obmc/led/clear-all/faults/config"

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-fault-leds@true.service"
TARGET_CLEAR="../obmc-clear-all-fault-leds@.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-fault-leds@true.service"
TARGET_CLEAR="../obmc-clear-all-fault-leds@.service"
ln -s $TARGET_CLEAR $LINK_CLEAR
}

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

LINK_CLEAR="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-clear-all-fault-leds@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