blob: f734bf530b80b1838a883d6af52e46fad45402ef [file] [log] [blame]
Adriana Kobylakb96c7502021-08-06 16:25:30 +00001FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
Vishwanatha Subbanna1a8345b2020-10-23 02:10:20 -05002
Adriana Kobylakb96c7502021-08-06 16:25:30 +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
Patrick Williamse83c2202021-09-01 16:17:33 -05006SYSTEMD_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
Adriana Kobylakb96c7502021-08-06 16:25:30 +000011PACKAGECONFIG: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
Adriana Kobylakb96c7502021-08-06 16:25:30 +000014SRC_URI:append:p10bmc = " file://lamp-test-led-overrides.json"
Vishwanatha Subbannada5117a2021-03-26 13:01:30 -050015
Adriana Kobylakb96c7502021-08-06 16:25:30 +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 Kobylakb96c7502021-08-06 16:25:30 +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 Kobylakb96c7502021-08-06 16:25:30 +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}