blob: 0ae5474e876859389862b0b38a4055154b0ee08a [file] [log] [blame]
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -05001FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
Adriana Kobylak6e77b402021-03-25 16:44:27 +00003SYSTEMD_SERVICE_${PN}_append_p10bmc += "obmc-led-set-all-groups-asserted@.service obmc-led-create-virtual-leds@.service"
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -05004
5# Copies config file having arguments for led-set-all-groups-asserted.sh
Adriana Kobylak6e77b402021-03-25 16:44:27 +00006SYSTEMD_ENVIRONMENT_FILE_${PN}_append_p10bmc +="obmc/led/set-all/groups/config"
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -05007
Vishwanatha Subbanna9f410cc2021-03-23 13:52:11 +00008# Use the JSON configuration file at runtime than the static led.yaml
Adriana Kobylak6e77b402021-03-25 16:44:27 +00009# Also, enable Lamp Test feature for p10bmc systems
10PACKAGECONFIG_append_p10bmc = " use-json use-lamp-test"
Vishwanatha Subbanna9f410cc2021-03-23 13:52:11 +000011
Adriana Kobylak6e77b402021-03-25 16:44:27 +000012# Install the lamp test override file for p10bmc
13SRC_URI_append_p10bmc = " file://lamp-test-led-overrides.json"
Vishwanatha Subbannada5117a2021-03-26 13:01:30 -050014
Adriana Kobylak6e77b402021-03-25 16:44:27 +000015pkg_postinst_${PN}_p10bmc () {
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -050016
17 # Needed this to run as part of BMC boot
18 mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
19 LINK="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-set-all-groups-asserted@false.service"
20 TARGET="../obmc-led-set-all-groups-asserted@.service"
21 ln -s $TARGET $LINK
22
23 # Needed this to run as part of Power On
24 mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants
25 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-led-set-all-groups-asserted@false.service"
26 TARGET="../obmc-led-set-all-groups-asserted@.service"
27 ln -s $TARGET $LINK
Vishwanatha Subbannada5117a2021-03-26 13:01:30 -050028
29 # Needed this to run as part of BMC boot
30 mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
31 LINK_FAULT="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-fault.service"
32 TARGET_FAULT="../obmc-led-create-virtual-leds@.service"
33 ln -s $TARGET_FAULT $LINK_FAULT
34
35 # Needed this to run as part of BMC boot
36 mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
37 LINK_ID="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-id.service"
38 TARGET_ID="../obmc-led-create-virtual-leds@.service"
39 ln -s $TARGET_ID $LINK_ID
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -050040}
41
Adriana Kobylak6e77b402021-03-25 16:44:27 +000042pkg_prerm_${PN}_p10bmc () {
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -050043
44 LINK="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-set-all-groups-asserted@false.service"
45 rm $LINK
46
47 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-led-set-all-groups-asserted@false.service"
48 rm $LINK
Vishwanatha Subbannada5117a2021-03-26 13:01:30 -050049
50 LINK_FAULT="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-fault.service"
51 rm $LINK_FAULT
52
53 LINK_ID="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-id.service"
54 rm $LINK_ID
55}
56
57# Install lamp test override json
Adriana Kobylak6e77b402021-03-25 16:44:27 +000058do_install_append_p10bmc() {
Vishwanatha Subbannada5117a2021-03-26 13:01:30 -050059 install -d ${D}${datadir}/${BPN}/
60 install -m 0644 ${WORKDIR}/lamp-test-led-overrides.json ${D}${datadir}/${BPN}/
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -050061}