blob: 8e74e69a06a9efcdf448a6eb16f6c31fbe6d48b9 [file] [log] [blame]
Patrick Williams267c0bb2017-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 Venturee22ac6b2018-10-21 08:23:40 -07007PV = "1.0+git${SRCPV}"
Patrick Williams267c0bb2017-01-19 21:20:46 -06008LICENSE = "Apache-2.0"
9LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
10
Andrew Geissler5059a442020-03-09 16:51:27 -050011include phosphor-state-manager-systemd-links.inc
12
Patrick Williams267c0bb2017-01-19 21:20:46 -060013STATE_MGR_PACKAGES = " \
14 ${PN}-host \
15 ${PN}-chassis \
Josh Kinga9462882017-01-19 14:04:03 -060016 ${PN}-bmc \
Michael Tritz7199d262017-04-18 17:01:12 -050017 ${PN}-discover \
Andrew Geisslera94faf42017-05-08 15:58:01 -050018 ${PN}-host-check \
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060019 ${PN}-reset-sensor-states \
Andrew Geisslerf26fd902019-09-23 19:11:20 +000020 ${PN}-systemd-target-monitor \
Andrew Geissler77cfb0f2020-01-14 14:21:24 -060021 ${PN}-obmc-targets \
Andrew Geissler73b97112020-04-15 16:02:17 +000022 ${PN}-scheduled-host-transition \
Patrick Williams267c0bb2017-01-19 21:20:46 -060023"
Brad Bishopf6f49d52018-04-11 11:44:15 -040024PACKAGE_BEFORE_PN += "${STATE_MGR_PACKAGES}"
25ALLOW_EMPTY_${PN} = "1"
Brad Bishopc3f10572017-03-01 16:08:45 -050026
Patrick Williams267c0bb2017-01-19 21:20:46 -060027DBUS_PACKAGES = "${STATE_MGR_PACKAGES}"
28
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060029SYSTEMD_PACKAGES = "${PN}-discover \
30 ${PN}-reset-sensor-states \
Andrew Geisslerf26fd902019-09-23 19:11:20 +000031 ${PN}-systemd-target-monitor \
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060032"
Andrew Geissler7a4341e2018-03-13 11:46:27 -070033
34# The host-check function will check if the host is running
35# after a BMC reset.
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060036# The reset-sensor-states function will reset the host
Andrew Geissler7a4341e2018-03-13 11:46:27 -070037# sensors on a BMC reset or system power loss.
38# Neither is required for host state function but are
39# recommended to deal properly with these reset scenarios.
40RRECOMMENDS_${PN}-host = "${PN}-host-check ${PN}-reset-sensor-states"
Patrick Williams267c0bb2017-01-19 21:20:46 -060041
Andrew Geissler77cfb0f2020-01-14 14:21:24 -060042# The obmc-targets are the base targets required to boot a computer system
43RRECOMMENDS_${PN}-host += "${PN}-obmc-targets"
44
Andrew Geisslerc1debbb2019-12-11 14:51:20 -060045inherit meson pkgconfig
Patrick Williams267c0bb2017-01-19 21:20:46 -060046inherit obmc-phosphor-dbus-service
Andrew Geisslerde30c982020-03-09 16:59:22 -050047inherit obmc-phosphor-systemd
Patrick Williams267c0bb2017-01-19 21:20:46 -060048
Patrick Williams267c0bb2017-01-19 21:20:46 -060049DEPENDS += "sdbusplus"
William A. Kennington IIIf0e66742018-10-18 01:34:43 -070050DEPENDS += "sdeventplus"
Patrick Williams267c0bb2017-01-19 21:20:46 -060051DEPENDS += "phosphor-logging"
Patrick Williamsd0486d82017-01-30 11:06:16 -060052DEPENDS += "phosphor-dbus-interfaces"
Brad Bishopcc51cd92018-10-18 17:07:53 -040053DEPENDS += "libcereal"
Andrew Geisslerf26fd902019-09-23 19:11:20 +000054DEPENDS += "nlohmann-json"
55DEPENDS += "cli11"
Patrick Williams267c0bb2017-01-19 21:20:46 -060056
Anthony Wilson3492fb92019-03-30 08:11:32 -070057FILES_${PN}-host = "${bindir}/phosphor-host-state-manager"
Patrick Williams267c0bb2017-01-19 21:20:46 -060058DBUS_SERVICE_${PN}-host += "xyz.openbmc_project.State.Host.service"
Andrew Geisslercd2b9462017-07-26 17:53:04 -050059DBUS_SERVICE_${PN}-host += "phosphor-reboot-host@.service"
Andrew Geissler22957e82018-03-27 19:39:05 -070060SYSTEMD_SERVICE_${PN}-host += "phosphor-reset-host-reboot-attempts@.service"
Andrew Geissler948e50a2020-11-04 16:41:45 +000061SYSTEMD_SERVICE_${PN}-host += "phosphor-clear-one-time@.service"
Patrick Williams267c0bb2017-01-19 21:20:46 -060062
Anthony Wilson3492fb92019-03-30 08:11:32 -070063FILES_${PN}-chassis = "${bindir}/phosphor-chassis-state-manager"
Patrick Williams267c0bb2017-01-19 21:20:46 -060064DBUS_SERVICE_${PN}-chassis += "xyz.openbmc_project.State.Chassis.service"
65
Anthony Wilson3492fb92019-03-30 08:11:32 -070066FILES_${PN}-chassis += "${bindir}/obmcutil"
67
68FILES_${PN}-bmc = "${bindir}/phosphor-bmc-state-manager"
Josh Kinga9462882017-01-19 14:04:03 -060069DBUS_SERVICE_${PN}-bmc += "xyz.openbmc_project.State.BMC.service"
70
Anthony Wilson3492fb92019-03-30 08:11:32 -070071FILES_${PN}-discover = "${bindir}/phosphor-discover-system-state"
Michael Tritz1f792e02017-03-31 12:04:32 -050072SYSTEMD_SERVICE_${PN}-discover += "phosphor-discover-system-state@.service"
73
Anthony Wilson3492fb92019-03-30 08:11:32 -070074FILES_${PN}-host-check = "${bindir}/phosphor-host-check"
Andrew Geisslera94faf42017-05-08 15:58:01 -050075SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-check@.service"
76SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-running@.service"
77
Dhruvaraj Subhashchandran39179e52017-12-17 12:06:23 -060078SYSTEMD_SERVICE_${PN}-reset-sensor-states += "phosphor-reset-sensor-states@.service"
79
Andrew Geisslerf26fd902019-09-23 19:11:20 +000080FILES_${PN}-systemd-target-monitor = " \
81 ${bindir}/phosphor-systemd-target-monitor \
82 ${sysconfdir}/phosphor-systemd-target-monitor/phosphor-target-monitor-default.json \
83 "
84SYSTEMD_SERVICE_${PN}-systemd-target-monitor += "phosphor-systemd-target-monitor.service"
85
Andrew Geissler73b97112020-04-15 16:02:17 +000086FILES_${PN}-scheduled-host-transition = "${bindir}/phosphor-scheduled-host-transition"
87DBUS_SERVICE_${PN}-scheduled-host-transition += "xyz.openbmc_project.State.ScheduledHostTransition.service"
88
Andrew Geissler77cfb0f2020-01-14 14:21:24 -060089# Chassis power synchronization targets
90# - start-pre: Services to run before we start power on process
91# - start: Services to run to do the chassis power on
92# - on: Services to run once power is on
93# - stop-pre,stop,off: Same as above but applied to powering off
94# - reset-on: Services to check if chassis power is on after bmc reset
95CHASSIS_SYNCH_TARGETS = "start-pre start on stop-pre stop off reset-on"
96
97# Chassis action power targets
98# - on: Services to run to power on the chassis
99# - off: Services to run to power off the chassis
100# - powered-off: Services to run once chassis power is off
101# - reset: Services to check chassis power state and update chassis "on" target
102# - hard-off: Services to force an immediate power off of the chassis
103CHASSIS_ACTION_TARGETS = "poweron poweroff powered-off powerreset hard-poweroff"
104
105# Track all host synchronization point targets
106# - start-pre: Services to run before we start host boot
107# - starting: Services to run to do the host boot
108# - started: Services to run once the host is booted
109# - stop-pre,stopping,stopped: Same as above but applied to shutting down the host
110# - reset-running: Services to check if host is running after bmc reset
111HOST_SYNCH_TARGETS = "start-pre starting started stop-pre stopping stopped reset-running"
112
113# Track all host action targets
114# - start: Will run startmin target, this target used for any additional
115# services that user needs for an initial power on of host.
116# For example, resetting the host reboot count could be put in
117# this target so on any fresh power on, this count is reset.
118# - startmin: Minimum services required to start the host. This target will
119# be called by reboot and start target.
120# - stop: Services to run to shutdown the host
121# - quiesce: Target to enter on host boot failure
122# - shutdown: Tell host to shutdown, then stop system
123# - reset: Services to check if host is running and update host "start" target
124# - crash: Target to run when host crashes. it is very much similar to
125# quiesce target but the only delta is that this target contains
126# multiple services and one of them is the quiesce target.
127# - timeout: Target to run when host watchdog times out
Andrew Geissleraccb4842020-02-10 13:47:12 -0600128# - reboot: Reboot the host with a chassis power cycle included
129# - warm-reboot: Reboot the host without a chassis power cycle.
130# - force-warm-reboot: Reboot the host without a chassis power cycle and without
131# notifying the host.
132# - diagnostic-mode: This will be entered when the host is collecting diagnostic
133# data for itself.
134HOST_ACTION_TARGETS = "start startmin stop quiesce reset shutdown crash timeout "
135HOST_ACTION_TARGETS += "reboot warm-reboot force-warm-reboot diagnostic-mode"
Andrew Geissler77cfb0f2020-01-14 14:21:24 -0600136
137CHASSIS_SYNCH_FMT = "obmc-power-{0}@.target"
138CHASSIS_ACTION_FMT = "obmc-chassis-{0}@.target"
139HOST_SYNCH_FMT = "obmc-host-{0}@.target"
140HOST_ACTION_FMT = "obmc-host-{0}@.target"
141
142CHASSIS_LINK_SYNCH_FMT = "${CHASSIS_SYNCH_FMT}:obmc-power-{0}@{1}.target"
143CHASSIS_LINK_ACTION_FMT = "${CHASSIS_ACTION_FMT}:obmc-chassis-{0}@{1}.target"
144HOST_LINK_SYNCH_FMT = "${HOST_SYNCH_FMT}:obmc-host-{0}@{1}.target"
145HOST_LINK_ACTION_FMT = "${HOST_ACTION_FMT}:obmc-host-{0}@{1}.target"
146FAN_LINK_FMT = "obmc-fan-control-ready@.target:obmc-fan-control-ready@{0}.target"
147
148# Targets to be executed on checkstop and watchdog timeout
149HOST_ERROR_TARGETS = "crash timeout"
150
151QUIESCE_TMPL = "obmc-host-quiesce@.target"
152CRASH_TIMEOUT_TGTFMT = "obmc-host-{0}@{1}.target"
153QUIESCE_INSTFMT = "obmc-host-quiesce@{1}.target"
154QUIESCE_FMT = "../${QUIESCE_TMPL}:${CRASH_TIMEOUT_TGTFMT}.wants/${QUIESCE_INSTFMT}"
155
156SYSTEMD_SERVICE_${PN}-obmc-targets += " \
157 obmc-mapper.target \
158 obmc-fans-ready.target \
159 obmc-fan-control.target \
160 obmc-fan-control-ready@.target \
161 obmc-fan-watchdog-takeover.target \
162 "
163
164SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS')}"
165SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_ACTION_FMT', 'CHASSIS_ACTION_TARGETS')}"
166SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'HOST_SYNCH_FMT', 'HOST_SYNCH_TARGETS')}"
167SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'HOST_ACTION_FMT', 'HOST_ACTION_TARGETS')}"
168
169SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_LINK_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
170SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_LINK_ACTION_FMT', 'CHASSIS_ACTION_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
171SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'HOST_LINK_SYNCH_FMT', 'HOST_SYNCH_TARGETS', 'OBMC_HOST_INSTANCES')}"
172SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'HOST_LINK_ACTION_FMT', 'HOST_ACTION_TARGETS', 'OBMC_HOST_INSTANCES')}"
173SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'FAN_LINK_FMT', 'OBMC_CHASSIS_INSTANCES')}"
174SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'QUIESCE_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
175
Patrick Williams267c0bb2017-01-19 21:20:46 -0600176SRC_URI += "git://github.com/openbmc/phosphor-state-manager"
Andrew Geissler2f0ae752020-11-13 19:02:53 +0000177SRCREV = "bbbc01655243fecc83f8734f12a57e665b90ff9a"
Patrick Williams267c0bb2017-01-19 21:20:46 -0600178
179S = "${WORKDIR}/git"