summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links-regulators.bb
blob: 6240fda48a8ff7a7a76ebd81651c84304762b581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
SUMMARY = "Phosphor Power Regulator services installation"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
PR = "r1"

inherit allarch

RDEPENDS:${PN} += "phosphor-power-regulators"

pkg_prerm:${PN}() {
        LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires/phosphor-regulators-config.service"
        rm $LINK

        LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.wants/phosphor-regulators-monitor-enable.service"
        rm $LINK

        LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@${i}.target.wants/phosphor-regulators-monitor-disable.service"
        rm $LINK
}
pkg_postinst:${PN}() {
        mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires
        LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/phosphor-regulators-config.service"
        TARGET="../phosphor-regulators-config.service"
        ln -s $TARGET $LINK

        mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants
        LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/phosphor-regulators-monitor-enable.service"
        TARGET="../phosphor-regulators-monitor-enable.service"
        ln -s $TARGET $LINK

        mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.wants
        LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.wants/phosphor-regulators-monitor-disable.service"
        TARGET="../phosphor-regulators-monitor-disable.service"
        ln -s $TARGET $LINK
}

ALLOW_EMPTY:${PN} = "1"