blob: a73f38709a97347c0b0108b10719b6360623bf51 [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 \
Michael Tritzb6e965c2017-04-18 17:01:12 -050017 ${PN}-discover \
Andrew Geisslerb1afecc2017-05-08 15:58:01 -050018 ${PN}-host-check \
Dhruvaraj Subhashchandranef07e6f2017-12-17 12:06:23 -060019 ${PN}-reset-sensor-states \
Andrew Geissler44cadef2019-09-23 19:11:20 +000020 ${PN}-systemd-target-monitor \
Andrew Geissler024c25d2020-01-14 14:21:24 -060021 ${PN}-obmc-targets \
Andrew Geissler98d98042020-04-15 16:02:17 +000022 ${PN}-scheduled-host-transition \
Patrick Williams9e206392017-01-19 21:20:46 -060023"
Brad Bishop7f9102c2018-04-11 11:44:15 -040024PACKAGE_BEFORE_PN += "${STATE_MGR_PACKAGES}"
25ALLOW_EMPTY_${PN} = "1"
Brad Bishop1a5a5972017-03-01 16:08:45 -050026
Patrick Williams9e206392017-01-19 21:20:46 -060027DBUS_PACKAGES = "${STATE_MGR_PACKAGES}"
28
Dhruvaraj Subhashchandranef07e6f2017-12-17 12:06:23 -060029SYSTEMD_PACKAGES = "${PN}-discover \
30 ${PN}-reset-sensor-states \
Andrew Geissler44cadef2019-09-23 19:11:20 +000031 ${PN}-systemd-target-monitor \
Dhruvaraj Subhashchandranef07e6f2017-12-17 12:06:23 -060032"
Andrew Geissler6bc2f022018-03-13 11:46:27 -070033
34# The host-check function will check if the host is running
35# after a BMC reset.
Dhruvaraj Subhashchandranef07e6f2017-12-17 12:06:23 -060036# The reset-sensor-states function will reset the host
Andrew Geissler6bc2f022018-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 Williams9e206392017-01-19 21:20:46 -060041
Andrew Geissler024c25d2020-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 Geisslerae3fe4a2019-12-11 14:51:20 -060045inherit meson pkgconfig
Patrick Williams9e206392017-01-19 21:20:46 -060046inherit obmc-phosphor-dbus-service
47
Patrick Williams9e206392017-01-19 21:20:46 -060048DEPENDS += "sdbusplus"
William A. Kennington IIIfa391f22018-10-18 01:34:43 -070049DEPENDS += "sdeventplus"
Patrick Williams9e206392017-01-19 21:20:46 -060050DEPENDS += "phosphor-logging"
Patrick Williams1815f6b2017-01-30 11:06:16 -060051DEPENDS += "phosphor-dbus-interfaces"
Brad Bishop17c08bf2018-10-18 17:07:53 -040052DEPENDS += "libcereal"
Andrew Geissler44cadef2019-09-23 19:11:20 +000053DEPENDS += "nlohmann-json"
54DEPENDS += "cli11"
Patrick Williams9e206392017-01-19 21:20:46 -060055
Anthony Wilsoncd800c82019-03-30 08:11:32 -070056FILES_${PN}-host = "${bindir}/phosphor-host-state-manager"
Patrick Williams9e206392017-01-19 21:20:46 -060057DBUS_SERVICE_${PN}-host += "xyz.openbmc_project.State.Host.service"
Andrew Geissler4ec27742017-07-26 17:53:04 -050058DBUS_SERVICE_${PN}-host += "phosphor-reboot-host@.service"
Andrew Geisslerec7f9202018-03-27 19:39:05 -070059SYSTEMD_SERVICE_${PN}-host += "phosphor-reset-host-reboot-attempts@.service"
Patrick Williams9e206392017-01-19 21:20:46 -060060
Anthony Wilsoncd800c82019-03-30 08:11:32 -070061FILES_${PN}-chassis = "${bindir}/phosphor-chassis-state-manager"
Patrick Williams9e206392017-01-19 21:20:46 -060062DBUS_SERVICE_${PN}-chassis += "xyz.openbmc_project.State.Chassis.service"
63
Anthony Wilsoncd800c82019-03-30 08:11:32 -070064FILES_${PN}-chassis += "${bindir}/obmcutil"
65
66FILES_${PN}-bmc = "${bindir}/phosphor-bmc-state-manager"
Josh Kingd2b95c72017-01-19 14:04:03 -060067DBUS_SERVICE_${PN}-bmc += "xyz.openbmc_project.State.BMC.service"
68
Anthony Wilsoncd800c82019-03-30 08:11:32 -070069FILES_${PN}-discover = "${bindir}/phosphor-discover-system-state"
Michael Tritzb3b58992017-03-31 12:04:32 -050070SYSTEMD_SERVICE_${PN}-discover += "phosphor-discover-system-state@.service"
71
Anthony Wilsoncd800c82019-03-30 08:11:32 -070072FILES_${PN}-host-check = "${bindir}/phosphor-host-check"
Andrew Geisslerb1afecc2017-05-08 15:58:01 -050073SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-check@.service"
74SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-running@.service"
75
Dhruvaraj Subhashchandranef07e6f2017-12-17 12:06:23 -060076SYSTEMD_SERVICE_${PN}-reset-sensor-states += "phosphor-reset-sensor-states@.service"
77
Andrew Geissler44cadef2019-09-23 19:11:20 +000078FILES_${PN}-systemd-target-monitor = " \
79 ${bindir}/phosphor-systemd-target-monitor \
80 ${sysconfdir}/phosphor-systemd-target-monitor/phosphor-target-monitor-default.json \
81 "
82SYSTEMD_SERVICE_${PN}-systemd-target-monitor += "phosphor-systemd-target-monitor.service"
83
Andrew Geissler98d98042020-04-15 16:02:17 +000084FILES_${PN}-scheduled-host-transition = "${bindir}/phosphor-scheduled-host-transition"
85DBUS_SERVICE_${PN}-scheduled-host-transition += "xyz.openbmc_project.State.ScheduledHostTransition.service"
86
Andrew Geissler024c25d2020-01-14 14:21:24 -060087# Chassis power synchronization targets
88# - start-pre: Services to run before we start power on process
89# - start: Services to run to do the chassis power on
90# - on: Services to run once power is on
91# - stop-pre,stop,off: Same as above but applied to powering off
92# - reset-on: Services to check if chassis power is on after bmc reset
93CHASSIS_SYNCH_TARGETS = "start-pre start on stop-pre stop off reset-on"
94
95# Chassis action power targets
96# - on: Services to run to power on the chassis
97# - off: Services to run to power off the chassis
98# - powered-off: Services to run once chassis power is off
99# - reset: Services to check chassis power state and update chassis "on" target
100# - hard-off: Services to force an immediate power off of the chassis
101CHASSIS_ACTION_TARGETS = "poweron poweroff powered-off powerreset hard-poweroff"
102
103# Track all host synchronization point targets
104# - start-pre: Services to run before we start host boot
105# - starting: Services to run to do the host boot
106# - started: Services to run once the host is booted
107# - stop-pre,stopping,stopped: Same as above but applied to shutting down the host
108# - reset-running: Services to check if host is running after bmc reset
109HOST_SYNCH_TARGETS = "start-pre starting started stop-pre stopping stopped reset-running"
110
111# Track all host action targets
112# - start: Will run startmin target, this target used for any additional
113# services that user needs for an initial power on of host.
114# For example, resetting the host reboot count could be put in
115# this target so on any fresh power on, this count is reset.
116# - startmin: Minimum services required to start the host. This target will
117# be called by reboot and start target.
118# - stop: Services to run to shutdown the host
119# - quiesce: Target to enter on host boot failure
120# - shutdown: Tell host to shutdown, then stop system
121# - reset: Services to check if host is running and update host "start" target
122# - crash: Target to run when host crashes. it is very much similar to
123# quiesce target but the only delta is that this target contains
124# multiple services and one of them is the quiesce target.
125# - timeout: Target to run when host watchdog times out
Andrew Geisslerbbe378e2020-02-10 13:47:12 -0600126# - reboot: Reboot the host with a chassis power cycle included
127# - warm-reboot: Reboot the host without a chassis power cycle.
128# - force-warm-reboot: Reboot the host without a chassis power cycle and without
129# notifying the host.
130# - diagnostic-mode: This will be entered when the host is collecting diagnostic
131# data for itself.
132HOST_ACTION_TARGETS = "start startmin stop quiesce reset shutdown crash timeout "
133HOST_ACTION_TARGETS += "reboot warm-reboot force-warm-reboot diagnostic-mode"
Andrew Geissler024c25d2020-01-14 14:21:24 -0600134
135CHASSIS_SYNCH_FMT = "obmc-power-{0}@.target"
136CHASSIS_ACTION_FMT = "obmc-chassis-{0}@.target"
137HOST_SYNCH_FMT = "obmc-host-{0}@.target"
138HOST_ACTION_FMT = "obmc-host-{0}@.target"
139
140CHASSIS_LINK_SYNCH_FMT = "${CHASSIS_SYNCH_FMT}:obmc-power-{0}@{1}.target"
141CHASSIS_LINK_ACTION_FMT = "${CHASSIS_ACTION_FMT}:obmc-chassis-{0}@{1}.target"
142HOST_LINK_SYNCH_FMT = "${HOST_SYNCH_FMT}:obmc-host-{0}@{1}.target"
143HOST_LINK_ACTION_FMT = "${HOST_ACTION_FMT}:obmc-host-{0}@{1}.target"
144FAN_LINK_FMT = "obmc-fan-control-ready@.target:obmc-fan-control-ready@{0}.target"
145
146# Targets to be executed on checkstop and watchdog timeout
147HOST_ERROR_TARGETS = "crash timeout"
148
149QUIESCE_TMPL = "obmc-host-quiesce@.target"
150CRASH_TIMEOUT_TGTFMT = "obmc-host-{0}@{1}.target"
151QUIESCE_INSTFMT = "obmc-host-quiesce@{1}.target"
152QUIESCE_FMT = "../${QUIESCE_TMPL}:${CRASH_TIMEOUT_TGTFMT}.wants/${QUIESCE_INSTFMT}"
153
154SYSTEMD_SERVICE_${PN}-obmc-targets += " \
155 obmc-mapper.target \
156 obmc-fans-ready.target \
157 obmc-fan-control.target \
158 obmc-fan-control-ready@.target \
159 obmc-fan-watchdog-takeover.target \
160 "
161
162SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS')}"
163SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_ACTION_FMT', 'CHASSIS_ACTION_TARGETS')}"
164SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'HOST_SYNCH_FMT', 'HOST_SYNCH_TARGETS')}"
165SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'HOST_ACTION_FMT', 'HOST_ACTION_TARGETS')}"
166
167SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_LINK_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
168SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_LINK_ACTION_FMT', 'CHASSIS_ACTION_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
169SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'HOST_LINK_SYNCH_FMT', 'HOST_SYNCH_TARGETS', 'OBMC_HOST_INSTANCES')}"
170SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'HOST_LINK_ACTION_FMT', 'HOST_ACTION_TARGETS', 'OBMC_HOST_INSTANCES')}"
171SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'FAN_LINK_FMT', 'OBMC_CHASSIS_INSTANCES')}"
172SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'QUIESCE_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
173
Patrick Williams9e206392017-01-19 21:20:46 -0600174SRC_URI += "git://github.com/openbmc/phosphor-state-manager"
Andrew Geisslerac9f2f42020-09-23 15:11:34 +0000175SRCREV = "162c7bfb0cbedcc5ccaf74c773da5a7c81fef8b1"
Patrick Williams9e206392017-01-19 21:20:46 -0600176
177S = "${WORKDIR}/git"