blob: 77df3acf5dd5285e31eb7049139782cfe2fff8bb [file] [log] [blame]
Lei YU2172cd12020-02-06 15:43:35 +08001SUMMARY = "Phosphor Power Monitor services installation"
2PR = "r1"
3
4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
6
7inherit allarch
8
9RDEPENDS_${PN}-monitor += "phosphor-power-monitor"
10
11ALLOW_EMPTY_${PN} = "1"
12
13
14pkg_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
26pkg_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}