Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 1 | SUMMARY = "Phosphor State Management" |
| 2 | DESCRIPTION = "Phosphor State Manager provides a set of system state \ |
| 3 | management daemons. It is suitable for use on a wide variety of OpenBMC \ |
| 4 | platforms." |
| 5 | HOMEPAGE = "https://github.com/openbmc/phosphor-state-manager" |
| 6 | PR = "r1" |
Patrick Venture | e22ac6b | 2018-10-21 08:23:40 -0700 | [diff] [blame] | 7 | PV = "1.0+git${SRCPV}" |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 8 | LICENSE = "Apache-2.0" |
| 9 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" |
| 10 | |
Andrew Geissler | 5059a44 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 11 | include phosphor-state-manager-systemd-links.inc |
| 12 | |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 13 | STATE_MGR_PACKAGES = " \ |
| 14 | ${PN}-host \ |
| 15 | ${PN}-chassis \ |
Josh King | a946288 | 2017-01-19 14:04:03 -0600 | [diff] [blame] | 16 | ${PN}-bmc \ |
Michael Tritz | 7199d26 | 2017-04-18 17:01:12 -0500 | [diff] [blame] | 17 | ${PN}-discover \ |
Andrew Geissler | a94faf4 | 2017-05-08 15:58:01 -0500 | [diff] [blame] | 18 | ${PN}-host-check \ |
Dhruvaraj Subhashchandran | 39179e5 | 2017-12-17 12:06:23 -0600 | [diff] [blame] | 19 | ${PN}-reset-sensor-states \ |
Andrew Geissler | f26fd90 | 2019-09-23 19:11:20 +0000 | [diff] [blame] | 20 | ${PN}-systemd-target-monitor \ |
Andrew Geissler | 77cfb0f | 2020-01-14 14:21:24 -0600 | [diff] [blame] | 21 | ${PN}-obmc-targets \ |
Andrew Geissler | 73b9711 | 2020-04-15 16:02:17 +0000 | [diff] [blame] | 22 | ${PN}-scheduled-host-transition \ |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 23 | " |
Brad Bishop | f6f49d5 | 2018-04-11 11:44:15 -0400 | [diff] [blame] | 24 | PACKAGE_BEFORE_PN += "${STATE_MGR_PACKAGES}" |
| 25 | ALLOW_EMPTY_${PN} = "1" |
Brad Bishop | c3f1057 | 2017-03-01 16:08:45 -0500 | [diff] [blame] | 26 | |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 27 | DBUS_PACKAGES = "${STATE_MGR_PACKAGES}" |
| 28 | |
Dhruvaraj Subhashchandran | 39179e5 | 2017-12-17 12:06:23 -0600 | [diff] [blame] | 29 | SYSTEMD_PACKAGES = "${PN}-discover \ |
| 30 | ${PN}-reset-sensor-states \ |
Andrew Geissler | f26fd90 | 2019-09-23 19:11:20 +0000 | [diff] [blame] | 31 | ${PN}-systemd-target-monitor \ |
Dhruvaraj Subhashchandran | 39179e5 | 2017-12-17 12:06:23 -0600 | [diff] [blame] | 32 | " |
Andrew Geissler | 7a4341e | 2018-03-13 11:46:27 -0700 | [diff] [blame] | 33 | |
| 34 | # The host-check function will check if the host is running |
| 35 | # after a BMC reset. |
Dhruvaraj Subhashchandran | 39179e5 | 2017-12-17 12:06:23 -0600 | [diff] [blame] | 36 | # The reset-sensor-states function will reset the host |
Andrew Geissler | 7a4341e | 2018-03-13 11:46:27 -0700 | [diff] [blame] | 37 | # 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. |
| 40 | RRECOMMENDS_${PN}-host = "${PN}-host-check ${PN}-reset-sensor-states" |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 41 | |
Andrew Geissler | 77cfb0f | 2020-01-14 14:21:24 -0600 | [diff] [blame] | 42 | # The obmc-targets are the base targets required to boot a computer system |
| 43 | RRECOMMENDS_${PN}-host += "${PN}-obmc-targets" |
| 44 | |
Andrew Geissler | c1debbb | 2019-12-11 14:51:20 -0600 | [diff] [blame] | 45 | inherit meson pkgconfig |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 46 | inherit obmc-phosphor-dbus-service |
Andrew Geissler | de30c98 | 2020-03-09 16:59:22 -0500 | [diff] [blame] | 47 | inherit obmc-phosphor-systemd |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 48 | |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 49 | DEPENDS += "sdbusplus" |
William A. Kennington III | f0e6674 | 2018-10-18 01:34:43 -0700 | [diff] [blame] | 50 | DEPENDS += "sdeventplus" |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 51 | DEPENDS += "phosphor-logging" |
Patrick Williams | d0486d8 | 2017-01-30 11:06:16 -0600 | [diff] [blame] | 52 | DEPENDS += "phosphor-dbus-interfaces" |
Brad Bishop | cc51cd9 | 2018-10-18 17:07:53 -0400 | [diff] [blame] | 53 | DEPENDS += "libcereal" |
Andrew Geissler | f26fd90 | 2019-09-23 19:11:20 +0000 | [diff] [blame] | 54 | DEPENDS += "nlohmann-json" |
| 55 | DEPENDS += "cli11" |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 56 | |
Anthony Wilson | 3492fb9 | 2019-03-30 08:11:32 -0700 | [diff] [blame] | 57 | FILES_${PN}-host = "${bindir}/phosphor-host-state-manager" |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 58 | DBUS_SERVICE_${PN}-host += "xyz.openbmc_project.State.Host.service" |
Andrew Geissler | cd2b946 | 2017-07-26 17:53:04 -0500 | [diff] [blame] | 59 | DBUS_SERVICE_${PN}-host += "phosphor-reboot-host@.service" |
Andrew Geissler | 22957e8 | 2018-03-27 19:39:05 -0700 | [diff] [blame] | 60 | SYSTEMD_SERVICE_${PN}-host += "phosphor-reset-host-reboot-attempts@.service" |
Andrew Geissler | 948e50a | 2020-11-04 16:41:45 +0000 | [diff] [blame] | 61 | SYSTEMD_SERVICE_${PN}-host += "phosphor-clear-one-time@.service" |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 62 | |
Anthony Wilson | 3492fb9 | 2019-03-30 08:11:32 -0700 | [diff] [blame] | 63 | FILES_${PN}-chassis = "${bindir}/phosphor-chassis-state-manager" |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 64 | DBUS_SERVICE_${PN}-chassis += "xyz.openbmc_project.State.Chassis.service" |
| 65 | |
Anthony Wilson | 3492fb9 | 2019-03-30 08:11:32 -0700 | [diff] [blame] | 66 | FILES_${PN}-chassis += "${bindir}/obmcutil" |
| 67 | |
| 68 | FILES_${PN}-bmc = "${bindir}/phosphor-bmc-state-manager" |
Josh King | a946288 | 2017-01-19 14:04:03 -0600 | [diff] [blame] | 69 | DBUS_SERVICE_${PN}-bmc += "xyz.openbmc_project.State.BMC.service" |
| 70 | |
Anthony Wilson | 3492fb9 | 2019-03-30 08:11:32 -0700 | [diff] [blame] | 71 | FILES_${PN}-discover = "${bindir}/phosphor-discover-system-state" |
Michael Tritz | 1f792e0 | 2017-03-31 12:04:32 -0500 | [diff] [blame] | 72 | SYSTEMD_SERVICE_${PN}-discover += "phosphor-discover-system-state@.service" |
| 73 | |
Anthony Wilson | 3492fb9 | 2019-03-30 08:11:32 -0700 | [diff] [blame] | 74 | FILES_${PN}-host-check = "${bindir}/phosphor-host-check" |
Andrew Geissler | a94faf4 | 2017-05-08 15:58:01 -0500 | [diff] [blame] | 75 | SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-check@.service" |
| 76 | SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-running@.service" |
| 77 | |
Dhruvaraj Subhashchandran | 39179e5 | 2017-12-17 12:06:23 -0600 | [diff] [blame] | 78 | SYSTEMD_SERVICE_${PN}-reset-sensor-states += "phosphor-reset-sensor-states@.service" |
| 79 | |
Andrew Geissler | f26fd90 | 2019-09-23 19:11:20 +0000 | [diff] [blame] | 80 | FILES_${PN}-systemd-target-monitor = " \ |
| 81 | ${bindir}/phosphor-systemd-target-monitor \ |
| 82 | ${sysconfdir}/phosphor-systemd-target-monitor/phosphor-target-monitor-default.json \ |
| 83 | " |
| 84 | SYSTEMD_SERVICE_${PN}-systemd-target-monitor += "phosphor-systemd-target-monitor.service" |
| 85 | |
Andrew Geissler | 73b9711 | 2020-04-15 16:02:17 +0000 | [diff] [blame] | 86 | FILES_${PN}-scheduled-host-transition = "${bindir}/phosphor-scheduled-host-transition" |
| 87 | DBUS_SERVICE_${PN}-scheduled-host-transition += "xyz.openbmc_project.State.ScheduledHostTransition.service" |
| 88 | |
Andrew Geissler | 77cfb0f | 2020-01-14 14:21:24 -0600 | [diff] [blame] | 89 | # 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 |
| 95 | CHASSIS_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 |
| 103 | CHASSIS_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 |
| 111 | HOST_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 Geissler | accb484 | 2020-02-10 13:47:12 -0600 | [diff] [blame] | 128 | # - 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. |
| 134 | HOST_ACTION_TARGETS = "start startmin stop quiesce reset shutdown crash timeout " |
| 135 | HOST_ACTION_TARGETS += "reboot warm-reboot force-warm-reboot diagnostic-mode" |
Andrew Geissler | 77cfb0f | 2020-01-14 14:21:24 -0600 | [diff] [blame] | 136 | |
| 137 | CHASSIS_SYNCH_FMT = "obmc-power-{0}@.target" |
| 138 | CHASSIS_ACTION_FMT = "obmc-chassis-{0}@.target" |
| 139 | HOST_SYNCH_FMT = "obmc-host-{0}@.target" |
| 140 | HOST_ACTION_FMT = "obmc-host-{0}@.target" |
| 141 | |
| 142 | CHASSIS_LINK_SYNCH_FMT = "${CHASSIS_SYNCH_FMT}:obmc-power-{0}@{1}.target" |
| 143 | CHASSIS_LINK_ACTION_FMT = "${CHASSIS_ACTION_FMT}:obmc-chassis-{0}@{1}.target" |
| 144 | HOST_LINK_SYNCH_FMT = "${HOST_SYNCH_FMT}:obmc-host-{0}@{1}.target" |
| 145 | HOST_LINK_ACTION_FMT = "${HOST_ACTION_FMT}:obmc-host-{0}@{1}.target" |
| 146 | FAN_LINK_FMT = "obmc-fan-control-ready@.target:obmc-fan-control-ready@{0}.target" |
| 147 | |
| 148 | # Targets to be executed on checkstop and watchdog timeout |
| 149 | HOST_ERROR_TARGETS = "crash timeout" |
| 150 | |
| 151 | QUIESCE_TMPL = "obmc-host-quiesce@.target" |
| 152 | CRASH_TIMEOUT_TGTFMT = "obmc-host-{0}@{1}.target" |
| 153 | QUIESCE_INSTFMT = "obmc-host-quiesce@{1}.target" |
| 154 | QUIESCE_FMT = "../${QUIESCE_TMPL}:${CRASH_TIMEOUT_TGTFMT}.wants/${QUIESCE_INSTFMT}" |
| 155 | |
| 156 | SYSTEMD_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 | |
| 164 | SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS')}" |
| 165 | SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_ACTION_FMT', 'CHASSIS_ACTION_TARGETS')}" |
| 166 | SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'HOST_SYNCH_FMT', 'HOST_SYNCH_TARGETS')}" |
| 167 | SYSTEMD_SERVICE_${PN}-obmc-targets += "${@compose_list(d, 'HOST_ACTION_FMT', 'HOST_ACTION_TARGETS')}" |
| 168 | |
| 169 | SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_LINK_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS', 'OBMC_CHASSIS_INSTANCES')}" |
| 170 | SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_LINK_ACTION_FMT', 'CHASSIS_ACTION_TARGETS', 'OBMC_CHASSIS_INSTANCES')}" |
| 171 | SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'HOST_LINK_SYNCH_FMT', 'HOST_SYNCH_TARGETS', 'OBMC_HOST_INSTANCES')}" |
| 172 | SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'HOST_LINK_ACTION_FMT', 'HOST_ACTION_TARGETS', 'OBMC_HOST_INSTANCES')}" |
| 173 | SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'FAN_LINK_FMT', 'OBMC_CHASSIS_INSTANCES')}" |
| 174 | SYSTEMD_LINK_${PN}-obmc-targets += "${@compose_list(d, 'QUIESCE_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}" |
| 175 | |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 176 | SRC_URI += "git://github.com/openbmc/phosphor-state-manager" |
Andrew Geissler | 2f0ae75 | 2020-11-13 19:02:53 +0000 | [diff] [blame] | 177 | SRCREV = "bbbc01655243fecc83f8734f12a57e665b90ff9a" |
Patrick Williams | 267c0bb | 2017-01-19 21:20:46 -0600 | [diff] [blame] | 178 | |
| 179 | S = "${WORKDIR}/git" |