Lei YU | 2172cd1 | 2020-02-06 15:43:35 +0800 | [diff] [blame] | 1 | SUMMARY = "Phosphor Power Monitor services installation" |
| 2 | PR = "r1" |
| 3 | |
| 4 | LICENSE = "Apache-2.0" |
| 5 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" |
| 6 | |
| 7 | inherit allarch |
| 8 | |
| 9 | RDEPENDS_${PN}-monitor += "phosphor-power-monitor" |
| 10 | |
| 11 | ALLOW_EMPTY_${PN} = "1" |
| 12 | |
| 13 | |
| 14 | pkg_postinst_${PN}() { |
| 15 | mkdir -p $D$systemd_system_unitdir/multi-user.target.requires |
| 16 | |
| 17 | [ -z "${OBMC_POWER_SUPPLY_INSTANCES}" ] && echo "No power supply instance defined" && exit 1 |
| 18 | |
| 19 | for inst in ${OBMC_POWER_SUPPLY_INSTANCES}; do |
| 20 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service" |
| 21 | TARGET="../power-supply-monitor@.service" |
| 22 | ln -s $TARGET $LINK |
| 23 | done |
| 24 | } |
| 25 | |
| 26 | pkg_prerm_${PN}() { |
| 27 | [ -z "${OBMC_POWER_SUPPLY_INSTANCES}" ] && echo "No power supply instance defined" && exit 1 |
| 28 | |
| 29 | for inst in ${OBMC_POWER_SUPPLY_INSTANCES}; do |
| 30 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service" |
| 31 | rm $LINK |
| 32 | done |
| 33 | } |