diff options
Diffstat (limited to 'meta-ibm/recipes-phosphor/leds')
3 files changed, 53 insertions, 4 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 612139550..96a97b040 100644 --- a/meta-ibm/recipes-phosphor/leds/phosphor-led-manager_%.bbappend +++ b/meta-ibm/recipes-phosphor/leds/phosphor-led-manager_%.bbappend @@ -1,11 +1,19 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SYSTEMD_SERVICE_${PN}-ledmanager_append_rainier += "obmc-led-set-all-groups-asserted@.service" +SYSTEMD_SERVICE_${PN}_append_p10bmc += "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}-ledmanager_append_rainier +="obmc/led/set-all/groups/config" +SYSTEMD_ENVIRONMENT_FILE_${PN}_append_p10bmc +="obmc/led/set-all/groups/config" -pkg_postinst_${PN}-ledmanager_rainier () { +# Use the JSON configuration file at runtime than the static led.yaml +# Also, enable Lamp Test and OperationalStatus monitor feature for +# p10bmc systems +PACKAGECONFIG_append_p10bmc = " use-json use-lamp-test monitor-operational-status" + +# Install the lamp test override file for p10bmc +SRC_URI_append_p10bmc = " file://lamp-test-led-overrides.json" + +pkg_postinst_${PN}_p10bmc () { # Needed this to run as part of BMC boot mkdir -p $D$systemd_system_unitdir/multi-user.target.wants @@ -18,13 +26,37 @@ pkg_postinst_${PN}-ledmanager_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}-ledmanager_rainier () { +pkg_prerm_${PN}_p10bmc () { 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 + + 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_p10bmc() { + install -d ${D}${datadir}/${BPN}/ + install -m 0644 ${WORKDIR}/lamp-test-led-overrides.json ${D}${datadir}/${BPN}/ } |