summaryrefslogtreecommitdiff
path: root/meta-facebook/meta-bletchley/recipes-phosphor/state/phosphor-state-manager_%.bbappend
blob: 1faa3019d6d97715a8a1e0b5aac5e50a7818bbe8 (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
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

SRC_URI:append = " \
    file://chassis-powercycle \
    file://chassis-powercycle@.service \
    file://chassis-poweroff@.service \
    file://chassis-poweron@.service \
    file://host-poweroff@.service \
    file://host-poweron@.service \
    "

RDEPENDS:${PN}-discover:append = " bletchley-common-tool"
RDEPENDS:${PN}:append = " bash motor-ctrl"

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-powercycle ${D}${libexecdir}/${PN}/
}

FILES:${PN}:append= " ${systemd_system_unitdir}"
FILES:${PN}:append= " ${libexecdir}/${PN}"

# Because Bletchley does not have IPMI between Bmc & Host, the Host init
# state will set to Off after Bmc booted. We require an extra service to
# check and set Host state & Chassis power state to correct state before
# doing any power action or power policy restore.

BLETCHLEY_SYS_ST_INIT_CONF_FMT = "bletchley-system-state-init.conf:phosphor-discover-system-state@{0}.service.d/bletchley-system-state-init.conf"
SYSTEMD_OVERRIDE:${PN}-discover += "${@compose_list_zip(d, 'BLETCHLEY_SYS_ST_INIT_CONF_FMT', 'OBMC_HOST_INSTANCES')}"

PACKAGECONFIG:append = "no-warm-reboot"
PACKAGECONFIG:remove = "only-run-apr-on-power-loss"

#======================
# Workaround for bletchley
#======================
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 \
"

HOST_DEFAULT_TARGETS:append = " \
    obmc-host-startmin@{}.target.wants/host-poweron@{}.service \
    obmc-host-stop@{}.target.wants/host-poweroff@{}.service \
"