summaryrefslogtreecommitdiff
path: root/meta-facebook/meta-harma/recipes-phosphor/state/phosphor-state-manager_%.bbappend
blob: aead043cb1b89cb8cf895a630f5760d300004a36 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

PACKAGECONFIG:remove = "only-run-apr-on-power-loss"
PACKAGECONFIG:append = " host-gpio"

# Chassis Config
# TODO: Remove it when 69903 applied
CHASSIS_DEFAULT_TARGETS:remove = " \
    obmc-chassis-powerreset@{}.target.requires/phosphor-reset-chassis-on@{}.service \
    obmc-chassis-powerreset@{}.target.requires/phosphor-reset-chassis-running@{}.service \
    obmc-chassis-poweroff@{}.target.requires/obmc-power-stop@{}.service \
    obmc-chassis-poweron@{}.target.requires/obmc-power-start@{}.service \
    "

# TODO: Remove it when 69903 applied
CHASSIS_DEFAULT_TARGETS:remove = " \
    obmc-chassis-poweron@{}.target.wants/chassis-poweron@{}.service \
    obmc-chassis-hard-poweroff@{}.target.wants/chassis-poweroff@{}.service \
    obmc-chassis-powercycle@{}.target.wants/chassis-powercycle@{}.service \
    "

# TODO: Remove it when 69903 applied
CHASSIS_DEFAULT_TARGETS:append = " \
    obmc-chassis-poweron@{}.target.requires/chassis-poweron@{}.service \
    obmc-chassis-powercycle@{}.target.requires/chassis-powercycle@{}.service \
    "
# TODO: Remove it when 69903 commit
CHASSIS_DEFAULT_TARGETS:append = " \
    obmc-chassis-poweroff@{}.target.requires/obmc-powered-off@{}.service \
    "

# Harma Chassis off is host force off
CHASSIS_DEFAULT_TARGETS:append = " \
    obmc-chassis-hard-poweroff@{}.target.requires/host-force-poweroff@{}.service \
    "

# Host Config
HOST_DEFAULT_TARGETS:remove = " \
    obmc-host-warm-reboot@{}.target.requires/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service \
    "

# TODO: Remove it when 69903 applied.
HOST_DEFAULT_TARGETS:append = " \
    obmc-host-startmin@{}.target.requires/host-poweron@{}.service \
    "

# TODO: Remove it when 69903 applied.
HOST_DEFAULT_TARGETS:append = " \
    obmc-host-shutdown@{}.target.requires/host-graceful-poweroff@{}.service \
    obmc-host-warm-reboot@{}.target.requires/host-graceful-poweroff@{}.service \
    "

# TODO: Remove it when 69903 applied.
HOST_DEFAULT_TARGETS:append = " \
    obmc-host-stop@{}.target.requires/host-force-poweroff@{}.service \
    "

# TODO: Remove it when 69903 applied.
HOST_DEFAULT_TARGETS:remove = " \
    obmc-host-shutdown@{}.target.wants/host-poweroff@{}.service \
    obmc-host-start@{}.target.wants/host-poweron@{}.service \
    obmc-host-reboot@{}.target.wants/host-powercycle@{}.service \
    obmc-host-force-warm-reboot@{}.target.wants/host-powerreset@{}.service \
    "

# TODO:  Remove when 69903 applied.
HOST_DEFAULT_TARGETS:remove = " \
    obmc-host-reboot@{}.target.requires/obmc-host-shutdown@{}.service \
    "

SRC_URI:append = " \
    file://chassis-powercycle \
    file://chassis-powercycle@.service \
    file://chassis-poweroff \
    file://chassis-poweroff@.service \
    file://chassis-poweron \
    file://chassis-poweron@.service \
    file://host-force-poweroff \
    file://host-force-poweroff@.service \
    file://host-graceful-poweroff \
    file://host-graceful-poweroff@.service \
    file://host-poweron \
    file://host-poweron@.service \
    file://power-cmd \
    file://phosphor-wait-power-off@.service \
    file://discover-sys-init.conf \
    file://phosphor-state-manager-init \
    file://phosphor-state-manager-init.conf \
    "

RDEPENDS:${PN}:append = " bash"

do_install:append() {
    install -d ${D}${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/*.service ${D}${systemd_system_unitdir}/

    install -d ${D}${libexecdir}/${PN}
    install -m 0755 ${WORKDIR}/chassis-poweroff ${D}${libexecdir}/${PN}/
    install -m 0755 ${WORKDIR}/chassis-poweron ${D}${libexecdir}/${PN}/
    install -m 0755 ${WORKDIR}/chassis-powercycle ${D}${libexecdir}/${PN}/
    install -m 0755 ${WORKDIR}/host-force-poweroff ${D}${libexecdir}/${PN}/
    install -m 0755 ${WORKDIR}/host-graceful-poweroff ${D}${libexecdir}/${PN}/
    install -m 0755 ${WORKDIR}/host-poweron ${D}${libexecdir}/${PN}/
    install -m 0755 ${WORKDIR}/power-cmd ${D}${libexecdir}/${PN}/
    install -m 0755 ${WORKDIR}/phosphor-state-manager-init ${D}${libexecdir}/${PN}/
}
SYSTEMD_OVERRIDE:${PN}-discover += "discover-sys-init.conf:phosphor-discover-system-state@0.service.d/discover-sys-init.conf"
SYSTEMD_OVERRIDE:${PN}-systemd-target-monitor += "phosphor-state-manager-init.conf:phosphor-systemd-target-monitor.service.d/phosphor-state-manager-init.conf"