blob: 2baaf0d70f90a5dc45c08866406b3bdcdcbc6dc8 [file] [log] [blame]
Lei YU4d8175e2019-10-21 10:39:07 +08001SUMMARY = "Phosphor Power 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} += "phosphor-power"
10
Lei YU4d8175e2019-10-21 10:39:07 +080011ALLOW_EMPTY_${PN} = "1"
12
13pkg_postinst_${PN}() {
14 mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants
15 mkdir -p $D$systemd_system_unitdir/multi-user.target.requires
16
17 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor.service"
18 TARGET="../pseq-monitor.service"
19 ln -s $TARGET $LINK
20
21 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor-pgood.service"
22 TARGET="../pseq-monitor-pgood.service"
23 ln -s $TARGET $LINK
24
Lei YU2e6bda82019-11-21 16:12:26 +080025 [ -z "${OBMC_POWER_SUPPLY_INSTANCES}" ] && echo "No power supply instance defined" && exit 1
26
27 for inst in ${OBMC_POWER_SUPPLY_INSTANCES}; do
Lei YU4d8175e2019-10-21 10:39:07 +080028 LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service"
29 TARGET="../power-supply-monitor@.service"
30 ln -s $TARGET $LINK
31 done
32}
33
34pkg_prerm_${PN}() {
35 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor.service"
36 rm $LINK
37 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor-pgood.service"
38 rm $LINK
Lei YU2e6bda82019-11-21 16:12:26 +080039
40 [ -z "${OBMC_POWER_SUPPLY_INSTANCES}" ] && echo "No power supply instance defined" && exit 1
41
42 for inst in ${OBMC_POWER_SUPPLY_INSTANCES}; do
Lei YU4d8175e2019-10-21 10:39:07 +080043 LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service"
44 rm $LINK
45 done
46}