Adriana Kobylak | b96c750 | 2021-08-06 16:25:30 +0000 | [diff] [blame] | 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" |
Vishwanatha Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 2 | |
Adriana Kobylak | b96c750 | 2021-08-06 16:25:30 +0000 | [diff] [blame] | 3 | SYSTEMD_SERVICE:${PN}:append:p10bmc += "obmc-led-set-all-groups-asserted@.service obmc-led-create-virtual-leds@.service" |
Vishwanatha Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 4 | |
| 5 | # Copies config file having arguments for led-set-all-groups-asserted.sh |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 6 | SYSTEMD_ENVIRONMENT_FILE:${PN}:append:p10bmc +="obmc/led/set-all/groups/config" |
Vishwanatha Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 7 | |
Vishwanatha Subbanna | 9f410cc | 2021-03-23 13:52:11 +0000 | [diff] [blame] | 8 | # Use the JSON configuration file at runtime than the static led.yaml |
Vishwanatha Subbanna | 06b43da | 2021-04-12 07:53:58 -0500 | [diff] [blame] | 9 | # Also, enable Lamp Test and OperationalStatus monitor feature for |
| 10 | # p10bmc systems |
Adriana Kobylak | b96c750 | 2021-08-06 16:25:30 +0000 | [diff] [blame] | 11 | PACKAGECONFIG:append:p10bmc = " use-json use-lamp-test monitor-operational-status" |
Vishwanatha Subbanna | 9f410cc | 2021-03-23 13:52:11 +0000 | [diff] [blame] | 12 | |
Adriana Kobylak | 6e77b40 | 2021-03-25 16:44:27 +0000 | [diff] [blame] | 13 | # Install the lamp test override file for p10bmc |
Adriana Kobylak | b96c750 | 2021-08-06 16:25:30 +0000 | [diff] [blame] | 14 | SRC_URI:append:p10bmc = " file://lamp-test-led-overrides.json" |
Vishwanatha Subbanna | da5117a | 2021-03-26 13:01:30 -0500 | [diff] [blame] | 15 | |
Adriana Kobylak | b96c750 | 2021-08-06 16:25:30 +0000 | [diff] [blame] | 16 | pkg_postinst:${PN}:p10bmc () { |
Vishwanatha Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 17 | |
| 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 Subbanna | da5117a | 2021-03-26 13:01:30 -0500 | [diff] [blame] | 29 | |
| 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 Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 41 | } |
| 42 | |
Adriana Kobylak | b96c750 | 2021-08-06 16:25:30 +0000 | [diff] [blame] | 43 | pkg_prerm:${PN}:p10bmc () { |
Vishwanatha Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 44 | |
| 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 Subbanna | da5117a | 2021-03-26 13:01:30 -0500 | [diff] [blame] | 50 | |
| 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 Kobylak | b96c750 | 2021-08-06 16:25:30 +0000 | [diff] [blame] | 59 | do_install:append:p10bmc() { |
Vishwanatha Subbanna | da5117a | 2021-03-26 13:01:30 -0500 | [diff] [blame] | 60 | install -d ${D}${datadir}/${BPN}/ |
| 61 | install -m 0644 ${WORKDIR}/lamp-test-led-overrides.json ${D}${datadir}/${BPN}/ |
Vishwanatha Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 62 | } |