Vishwanatha Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
| 2 | |
Adriana Kobylak | 6e77b40 | 2021-03-25 16:44:27 +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 |
Adriana Kobylak | 6e77b40 | 2021-03-25 16:44:27 +0000 | [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 |
Adriana Kobylak | 6e77b40 | 2021-03-25 16:44:27 +0000 | [diff] [blame^] | 9 | # Also, enable Lamp Test feature for p10bmc systems |
| 10 | PACKAGECONFIG_append_p10bmc = " use-json use-lamp-test" |
Vishwanatha Subbanna | 9f410cc | 2021-03-23 13:52:11 +0000 | [diff] [blame] | 11 | |
Adriana Kobylak | 6e77b40 | 2021-03-25 16:44:27 +0000 | [diff] [blame^] | 12 | # Install the lamp test override file for p10bmc |
| 13 | SRC_URI_append_p10bmc = " file://lamp-test-led-overrides.json" |
Vishwanatha Subbanna | da5117a | 2021-03-26 13:01:30 -0500 | [diff] [blame] | 14 | |
Adriana Kobylak | 6e77b40 | 2021-03-25 16:44:27 +0000 | [diff] [blame^] | 15 | pkg_postinst_${PN}_p10bmc () { |
Vishwanatha Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 16 | |
| 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 Subbanna | da5117a | 2021-03-26 13:01:30 -0500 | [diff] [blame] | 28 | |
| 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 Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 40 | } |
| 41 | |
Adriana Kobylak | 6e77b40 | 2021-03-25 16:44:27 +0000 | [diff] [blame^] | 42 | pkg_prerm_${PN}_p10bmc () { |
Vishwanatha Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 43 | |
| 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 Subbanna | da5117a | 2021-03-26 13:01:30 -0500 | [diff] [blame] | 49 | |
| 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 Kobylak | 6e77b40 | 2021-03-25 16:44:27 +0000 | [diff] [blame^] | 58 | do_install_append_p10bmc() { |
Vishwanatha Subbanna | da5117a | 2021-03-26 13:01:30 -0500 | [diff] [blame] | 59 | install -d ${D}${datadir}/${BPN}/ |
| 60 | install -m 0644 ${WORKDIR}/lamp-test-led-overrides.json ${D}${datadir}/${BPN}/ |
Vishwanatha Subbanna | 1a8345b | 2020-10-23 02:10:20 -0500 | [diff] [blame] | 61 | } |