blob: 0ee5e83034d992f9b662059386e5b4d2e27a0521 [file] [log] [blame]
Lei YU50ab1ac2019-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
11OBMC_POWER_SUPPLY_INSTANCES ?= "0"
12
13ALLOW_EMPTY_${PN} = "1"
14
15pkg_postinst_${PN}() {
16 mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants
17 mkdir -p $D$systemd_system_unitdir/multi-user.target.requires
18
19 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor.service"
20 TARGET="../pseq-monitor.service"
21 ln -s $TARGET $LINK
22
23 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor-pgood.service"
24 TARGET="../pseq-monitor-pgood.service"
25 ln -s $TARGET $LINK
26
27 for inst in $OBMC_POWER_SUPPLY_INSTANCES; do
28 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
39 for inst in $OBMC_POWER_SUPPLY_INSTANCES; do
40 LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service"
41 rm $LINK
42 done
43}