blob: b7f4bc8d5ccb78cb4fc376612f5c7dbeed8cf192 [file] [log] [blame]
Lei YU7307bed2020-02-06 15:43:35 +08001SUMMARY = "Phosphor Power Monitor services installation"
Lei YU7307bed2020-02-06 15:43:35 +08002LICENSE = "Apache-2.0"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
Ed Tanous9936f862022-09-19 09:13:20 -07004PR = "r1"
Lei YU7307bed2020-02-06 15:43:35 +08005
6inherit allarch
7
Patrick Williams12fc9392021-08-06 09:16:53 -05008RDEPENDS:${PN}-monitor += "phosphor-power-monitor"
Lei YU7307bed2020-02-06 15:43:35 +08009
Patrick Williams12fc9392021-08-06 09:16:53 -050010pkg_prerm:${PN}() {
Ed Tanous9936f862022-09-19 09:13:20 -070011 [ -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 YU7307bed2020-02-06 15:43:35 +080016}
Ed Tanous9936f862022-09-19 09:13:20 -070017pkg_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
27ALLOW_EMPTY:${PN} = "1"