blob: 96a97b040ddac3bd0f5336b84546d4510dd894eb [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
Vishwanatha Subbanna06b43da2021-04-12 07:53:58 -05009# Also, enable Lamp Test and OperationalStatus monitor feature for
10# p10bmc systems
11PACKAGECONFIG_append_p10bmc = " use-json use-lamp-test monitor-operational-status"
Vishwanatha Subbanna9f410cc2021-03-23 13:52:11 +000012
Adriana Kobylak6e77b402021-03-25 16:44:27 +000013# Install the lamp test override file for p10bmc
14SRC_URI_append_p10bmc = " file://lamp-test-led-overrides.json"
Vishwanatha Subbannada5117a2021-03-26 13:01:30 -050015
Adriana Kobylak6e77b402021-03-25 16:44:27 +000016pkg_postinst_${PN}_p10bmc () {
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -050017
18 # Needed this to run as part of BMC boot
19 mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
20 LINK="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-set-all-groups-asserted@false.service"
21 TARGET="../obmc-led-set-all-groups-asserted@.service"
22 ln -s $TARGET $LINK
23
24 # Needed this to run as part of Power On
25 mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants
26 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-led-set-all-groups-asserted@false.service"
27 TARGET="../obmc-led-set-all-groups-asserted@.service"
28 ln -s $TARGET $LINK
Vishwanatha Subbannada5117a2021-03-26 13:01:30 -050029
30 # Needed this to run as part of BMC boot
31 mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
32 LINK_FAULT="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-fault.service"
33 TARGET_FAULT="../obmc-led-create-virtual-leds@.service"
34 ln -s $TARGET_FAULT $LINK_FAULT
35
36 # Needed this to run as part of BMC boot
37 mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
38 LINK_ID="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-id.service"
39 TARGET_ID="../obmc-led-create-virtual-leds@.service"
40 ln -s $TARGET_ID $LINK_ID
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -050041}
42
Adriana Kobylak6e77b402021-03-25 16:44:27 +000043pkg_prerm_${PN}_p10bmc () {
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -050044
45 LINK="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-set-all-groups-asserted@false.service"
46 rm $LINK
47
48 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-led-set-all-groups-asserted@false.service"
49 rm $LINK
Vishwanatha Subbannada5117a2021-03-26 13:01:30 -050050
51 LINK_FAULT="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-fault.service"
52 rm $LINK_FAULT
53
54 LINK_ID="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-id.service"
55 rm $LINK_ID
56}
57
58# Install lamp test override json
Adriana Kobylak6e77b402021-03-25 16:44:27 +000059do_install_append_p10bmc() {
Vishwanatha Subbannada5117a2021-03-26 13:01:30 -050060 install -d ${D}${datadir}/${BPN}/
61 install -m 0644 ${WORKDIR}/lamp-test-led-overrides.json ${D}${datadir}/${BPN}/
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -050062}