blob: 2c0118efdedf0734ff9638851199285be3be670f [file] [log] [blame]
Patrick Williams9e206392017-01-19 21:20:46 -06001SUMMARY = "Phosphor State Management"
2DESCRIPTION = "Phosphor State Manager provides a set of system state \
3management daemons. It is suitable for use on a wide variety of OpenBMC \
4platforms."
5HOMEPAGE = "https://github.com/openbmc/phosphor-state-manager"
6PR = "r1"
Patrick Venturedcb29962018-10-21 08:23:40 -07007PV = "1.0+git${SRCPV}"
Patrick Williams9e206392017-01-19 21:20:46 -06008LICENSE = "Apache-2.0"
9LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
10
Andrew Geissler20cff702020-03-09 16:51:27 -050011include phosphor-state-manager-systemd-links.inc
12
Patrick Williams9e206392017-01-19 21:20:46 -060013STATE_MGR_PACKAGES = " \
14 ${PN}-host \
15 ${PN}-chassis \
Josh Kingd2b95c72017-01-19 14:04:03 -060016 ${PN}-bmc \
Andrew Geisslerb2644f82021-02-10 16:11:58 -060017 ${PN}-hypervisor \
Michael Tritzb6e965c2017-04-18 17:01:12 -050018 ${PN}-discover \
Andrew Geisslerb1afecc2017-05-08 15:58:01 -050019 ${PN}-host-check \
Dhruvaraj Subhashchandranef07e6f2017-12-17 12:06:23 -060020 ${PN}-reset-sensor-states \
Andrew Geissler44cadef2019-09-23 19:11:20 +000021 ${PN}-systemd-target-monitor \
Andrew Geissler024c25d2020-01-14 14:21:24 -060022 ${PN}-obmc-targets \
Andrew Geissler98d98042020-04-15 16:02:17 +000023 ${PN}-scheduled-host-transition \
Patrick Williams9e206392017-01-19 21:20:46 -060024"
Brad Bishop7f9102c2018-04-11 11:44:15 -040025PACKAGE_BEFORE_PN += "${STATE_MGR_PACKAGES}"
26ALLOW_EMPTY_${PN} = "1"
Brad Bishop1a5a5972017-03-01 16:08:45 -050027
Patrick Williams9e206392017-01-19 21:20:46 -060028DBUS_PACKAGES = "${STATE_MGR_PACKAGES}"
29
Dhruvaraj Subhashchandranef07e6f2017-12-17 12:06:23 -060030SYSTEMD_PACKAGES = "${PN}-discover \
31 ${PN}-reset-sensor-states \
Andrew Geissler44cadef2019-09-23 19:11:20 +000032 ${PN}-systemd-target-monitor \
Dhruvaraj Subhashchandranef07e6f2017-12-17 12:06:23 -060033"
Andrew Geissler6bc2f022018-03-13 11:46:27 -070034
35# The host-check function will check if the host is running
36# after a BMC reset.
Dhruvaraj Subhashchandranef07e6f2017-12-17 12:06:23 -060037# The reset-sensor-states function will reset the host
Andrew Geissler6bc2f022018-03-13 11:46:27 -070038# sensors on a BMC reset or system power loss.
39# Neither is required for host state function but are
40# recommended to deal properly with these reset scenarios.
41RRECOMMENDS_${PN}-host = "${PN}-host-check ${PN}-reset-sensor-states"
Patrick Williams9e206392017-01-19 21:20:46 -060042
Andrew Geissler024c25d2020-01-14 14:21:24 -060043# The obmc-targets are the base targets required to boot a computer system
44RRECOMMENDS_${PN}-host += "${PN}-obmc-targets"
45
Andrew Geisslerae3fe4a2019-12-11 14:51:20 -060046inherit meson pkgconfig
Patrick Williams9e206392017-01-19 21:20:46 -060047inherit obmc-phosphor-dbus-service
Andrew Geissler15834fd2020-03-09 16:59:22 -050048inherit obmc-phosphor-systemd
Patrick Williams9e206392017-01-19 21:20:46 -060049
Patrick Williams9e206392017-01-19 21:20:46 -060050DEPENDS += "sdbusplus"
William A. Kennington IIIfa391f22018-10-18 01:34:43 -070051DEPENDS += "sdeventplus"
Patrick Williams9e206392017-01-19 21:20:46 -060052DEPENDS += "phosphor-logging"
Patrick Williams1815f6b2017-01-30 11:06:16 -060053DEPENDS += "phosphor-dbus-interfaces"
Brad Bishop17c08bf2018-10-18 17:07:53 -040054DEPENDS += "libcereal"
Andrew Geissler44cadef2019-09-23 19:11:20 +000055DEPENDS += "nlohmann-json"
56DEPENDS += "cli11"
Patrick Williams9e206392017-01-19 21:20:46 -060057
Andrew Geissler0ff04752021-04-14 13:51:25 +000058RDEPENDS_${PN}-chassis += "bash"
59
Anthony Wilsoncd800c82019-03-30 08:11:32 -070060FILES_${PN}-host = "${bindir}/phosphor-host-state-manager"
Patrick Williams9e206392017-01-19 21:20:46 -060061DBUS_SERVICE_${PN}-host += "xyz.openbmc_project.State.Host.service"
Andrew Geissler4ec27742017-07-26 17:53:04 -050062DBUS_SERVICE_${PN}-host += "phosphor-reboot-host@.service"
Andrew Geisslerec7f9202018-03-27 19:39:05 -070063SYSTEMD_SERVICE_${PN}-host += "phosphor-reset-host-reboot-attempts@.service"
Andrew Geisslerb05ebce2020-11-04 16:41:45 +000064SYSTEMD_SERVICE_${PN}-host += "phosphor-clear-one-time@.service"
Andrew Geissler4ef0e112021-01-05 16:51:58 -060065SYSTEMD_SERVICE_${PN}-host += "phosphor-set-host-transition-to-running@.service"
66SYSTEMD_SERVICE_${PN}-host += "phosphor-set-host-transition-to-off@.service"
Patrick Williams9e206392017-01-19 21:20:46 -060067
Anthony Wilsoncd800c82019-03-30 08:11:32 -070068FILES_${PN}-chassis = "${bindir}/phosphor-chassis-state-manager"
Patrick Williams9e206392017-01-19 21:20:46 -060069DBUS_SERVICE_${PN}-chassis += "xyz.openbmc_project.State.Chassis.service"
70
Anthony Wilsoncd800c82019-03-30 08:11:32 -070071FILES_${PN}-chassis += "${bindir}/obmcutil"
72
73FILES_${PN}-bmc = "${bindir}/phosphor-bmc-state-manager"
Josh Kingd2b95c72017-01-19 14:04:03 -060074DBUS_SERVICE_${PN}-bmc += "xyz.openbmc_project.State.BMC.service"
75
Andrew Geisslerb2644f82021-02-10 16:11:58 -060076FILES_${PN}-hypervisor = "${bindir}/phosphor-hypervisor-state-manager"
77DBUS_SERVICE_${PN}-hypervisor += "xyz.openbmc_project.State.Hypervisor.service"
78
Anthony Wilsoncd800c82019-03-30 08:11:32 -070079FILES_${PN}-discover = "${bindir}/phosphor-discover-system-state"
Michael Tritzb3b58992017-03-31 12:04:32 -050080SYSTEMD_SERVICE_${PN}-discover += "phosphor-discover-system-state@.service"
81
Anthony Wilsoncd800c82019-03-30 08:11:32 -070082FILES_${PN}-host-check = "${bindir}/phosphor-host-check"
Andrew Geisslerb1afecc2017-05-08 15:58:01 -050083SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-check@.service"
84SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-running@.service"
85
Dhruvaraj Subhashchandranef07e6f2017-12-17 12:06:23 -060086SYSTEMD_SERVICE_${PN}-reset-sensor-states += "phosphor-reset-sensor-states@.service"
87
Andrew Geissler44cadef2019-09-23 19:11:20 +000088FILES_${PN}-systemd-target-monitor = " \
89 ${bindir}/phosphor-systemd-target-monitor \
90 ${sysconfdir}/phosphor-systemd-target-monitor/phosphor-target-monitor-default.json \
91 "
92SYSTEMD_SERVICE_${PN}-systemd-target-monitor += "phosphor-systemd-target-monitor.service"
93
Andrew Geissler98d98042020-04-15 16:02:17 +000094FILES_${PN}-scheduled-host-transition = "${bindir}/phosphor-scheduled-host-transition"
95DBUS_SERVICE_${PN}-scheduled-host-transition += "xyz.openbmc_project.State.ScheduledHostTransition.service"
96
Andrew Geissler024c25d2020-01-14 14:21:24 -060097# Chassis power synchronization targets
98# - start-pre: Services to run before we start power on process
99# - start: Services to run to do the chassis power on
100# - on: Services to run once power is on
101# - stop-pre,stop,off: Same as above but applied to powering off
102# - reset-on: Services to check if chassis power is on after bmc reset
103CHASSIS_SYNCH_TARGETS = "start-pre start on stop-pre stop off reset-on"
104
105# Chassis action power targets
106# - on: Services to run to power on the chassis
107# - off: Services to run to power off the chassis
108# - powered-off: Services to run once chassis power is off
109# - reset: Services to check chassis power state and update chassis "on" target
110# - hard-off: Services to force an immediate power off of the chassis
111CHASSIS_ACTION_TARGETS = "poweron poweroff powered-off powerreset hard-poweroff"
112
113# Track all host synchronization point targets
114# - start-pre: Services to run before we start host boot
115# - starting: Services to run to do the host boot
116# - started: Services to run once the host is booted
117# - stop-pre,stopping,stopped: Same as above but applied to shutting down the host
118# - reset-running: Services to check if host is running after bmc reset
119HOST_SYNCH_TARGETS = "start-pre starting started stop-pre stopping stopped reset-running"
120
121# Track all host action targets
122# - start: Will run startmin target, this target used for any additional
123# services that user needs for an initial power on of host.
124# For example, resetting the host reboot count could be put in
125# this target so on any fresh power on, this count is reset.
126# - startmin: Minimum services required to start the host. This target will
127# be called by reboot and start target.
128# - stop: Services to run to shutdown the host
129# - quiesce: Target to enter on host boot failure
130# - shutdown: Tell host to shutdown, then stop system
131# - reset: Services to check if host is running and update host "start" target
132# - crash: Target to run when host crashes. it is very much similar to
133# quiesce target but the only delta is that this target contains
134# multiple services and one of them is the quiesce target.
135# - timeout: Target to run when host watchdog times out
Andrew Geisslerbbe378e2020-02-10 13:47:12 -0600136# - reboot: Reboot the host with a chassis power cycle included
137# - warm-reboot: Reboot the host without a chassis power cycle.
138# - force-warm-reboot: Reboot the host without a chassis power cycle and without
139# notifying the host.
140# - diagnostic-mode: This will be entered when the host is collecting diagnostic
141# data for itself.
142HOST_ACTION_TARGETS = "start startmin stop quiesce reset shutdown crash timeout "
143HOST_ACTION_TARGETS += "reboot warm-reboot force-warm-reboot diagnostic-mode"
Andrew Geissler024c25d2020-01-14 14:21:24 -0600144
145CHASSIS_SYNCH_FMT = "obmc-power-{0}@.target"
146CHASSIS_ACTION_FMT = "obmc-chassis-{0}@.target"
147HOST_SYNCH_FMT = "obmc-host-{0}@.target"
148HOST_ACTION_FMT = "obmc-host-{0}@.target"
149
150CHASSIS_LINK_SYNCH_FMT = "${CHASSIS_SYNCH_FMT}:obmc-power-{0}@{1}.target"
151CHASSIS_LINK_ACTION_FMT = "${CHASSIS_ACTION_FMT}:obmc-chassis-{0}@{1}.target"
152HOST_LINK_SYNCH_FMT = "${HOST_SYNCH_FMT}:obmc-host-{0}@{1}.target"
153HOST_LINK_ACTION_FMT = "${HOST_ACTION_FMT}:obmc-host-{0}@{1}.target"
154FAN_LINK_FMT = "obmc-fan-control-ready@.target:obmc-fan-control-ready@{0}.target"
155
156# Targets to be executed on checkstop and watchdog timeout
Andrew Geissler91685cd2020-12-17 14:23:10 -0600157HOST_ERROR_TARGETS = "timeout"
Andrew Geissler024c25d2020-01-14 14:21:24 -0600158
159QUIESCE_TMPL = "obmc-host-quiesce@.target"
160CRASH_TIMEOUT_TGTFMT = "obmc-host-{0}@{1}.target"
161QUIESCE_INSTFMT = "obmc-host-quiesce@{1}.target"
162QUIESCE_FMT = "../${QUIESCE_TMPL}:${CRASH_TIMEOUT_TGTFMT}.wants/${QUIESCE_INSTFMT}"
163
164SYSTEMD_SERVICE_${PN}-obmc-targets += " \
165 obmc-mapper.target \
166 obmc-fans-ready.target \
167 obmc-fan-control.target \
168 obmc-fan-control-ready@.target \
169 obmc-fan-watchdog-takeover.target \
170 "
171
172SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS')}"
173SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_ACTION_FMT', 'CHASSIS_ACTION_TARGETS')}"
174SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'HOST_SYNCH_FMT', 'HOST_SYNCH_TARGETS')}"
175SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'HOST_ACTION_FMT', 'HOST_ACTION_TARGETS')}"
176
177SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_LINK_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
178SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_LINK_ACTION_FMT', 'CHASSIS_ACTION_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
179SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'HOST_LINK_SYNCH_FMT', 'HOST_SYNCH_TARGETS', 'OBMC_HOST_INSTANCES')}"
180SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'HOST_LINK_ACTION_FMT', 'HOST_ACTION_TARGETS', 'OBMC_HOST_INSTANCES')}"
181SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'FAN_LINK_FMT', 'OBMC_CHASSIS_INSTANCES')}"
182SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'QUIESCE_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
183
Patrick Williams9e206392017-01-19 21:20:46 -0600184SRC_URI += "git://github.com/openbmc/phosphor-state-manager"
Andrew Geissler0ff04752021-04-14 13:51:25 +0000185SRCREV = "525478053c362bf57f89ac032eed74cc7d3de744"
Patrick Williams9e206392017-01-19 21:20:46 -0600186
187S = "${WORKDIR}/git"