Lei YU | 7307bed | 2020-02-06 15:43:35 +0800 | [diff] [blame] | 1 | SUMMARY = "Phosphor Power Monitor services installation" |
Lei YU | 7307bed | 2020-02-06 15:43:35 +0800 | [diff] [blame] | 2 | LICENSE = "Apache-2.0" |
| 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 4 | PR = "r1" |
Lei YU | 7307bed | 2020-02-06 15:43:35 +0800 | [diff] [blame] | 5 | |
| 6 | inherit allarch |
| 7 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 8 | RDEPENDS:${PN}-monitor += "phosphor-power-monitor" |
Lei YU | 7307bed | 2020-02-06 15:43:35 +0800 | [diff] [blame] | 9 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 10 | pkg_prerm:${PN}() { |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 11 | [ -z "${OBMC_POWER_SUPPLY_INSTANCES}" ] && echo "No power supply instance defined" && exit 1 |
| 12 | for inst in ${OBMC_POWER_SUPPLY_INSTANCES}; do |
| 13 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service" |
| 14 | rm $LINK |
| 15 | done |
Lei YU | 7307bed | 2020-02-06 15:43:35 +0800 | [diff] [blame] | 16 | } |
Ed Tanous | 9936f86 | 2022-09-19 09:13:20 -0700 | [diff] [blame] | 17 | pkg_postinst:${PN}() { |
| 18 | mkdir -p $D$systemd_system_unitdir/multi-user.target.requires |
| 19 | [ -z "${OBMC_POWER_SUPPLY_INSTANCES}" ] && echo "No power supply instance defined" && exit 1 |
| 20 | for inst in ${OBMC_POWER_SUPPLY_INSTANCES}; do |
| 21 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service" |
| 22 | TARGET="../power-supply-monitor@.service" |
| 23 | ln -s $TARGET $LINK |
| 24 | done |
| 25 | } |
| 26 | |
| 27 | ALLOW_EMPTY:${PN} = "1" |