blob: f0051cfce04e00f17140cad9b63a5f95cd5c947c [file] [log] [blame]
Brad Bishope94b9152016-08-08 20:21:44 -04001SUMMARY = "Phosphor Systemd targets"
Gunnar Millsfb51a9a2018-01-09 16:40:15 -06002DESCRIPTION = "Provides well known Systemd synchronization points for OpenBMC."
Brad Bishope94b9152016-08-08 20:21:44 -04003HOMEPAGE = "http://github.com/openbmc"
4PR = "r1"
Patrick Venture776991a2018-11-03 14:20:22 -07005LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"
Brad Bishope94b9152016-08-08 20:21:44 -04007
8inherit obmc-phosphor-systemd
Brad Bishope94b9152016-08-08 20:21:44 -04009inherit allarch
10
Josh D. Kinga283e072017-04-06 15:56:37 -050011# Chassis power synchronization targets
Andrew Geissler997ed662017-03-05 20:36:50 -060012# - start-pre: Services to run before we start power on process
13# - start: Services to run to do the chassis power on
14# - on: Services to run once power is on
15# - stop-pre,stop,off: Same as above but applied to powering off
16# - reset-on: Services to check if chassis power is on after bmc reset
Josh D. Kinga283e072017-04-06 15:56:37 -050017CHASSIS_SYNCH_TARGETS = "start-pre start on stop-pre stop off reset-on"
Andrew Geissler997ed662017-03-05 20:36:50 -060018
Josh D. Kinga283e072017-04-06 15:56:37 -050019# Chassis action power targets
Andrew Geissler997ed662017-03-05 20:36:50 -060020# - on: Services to run to power on the chassis
21# - off: Services to run to power off the chassis
Matthew Barth1851aa62018-01-10 09:16:28 -060022# - powered-off: Services to run once chassis power is off
Andrew Geissler997ed662017-03-05 20:36:50 -060023# - reset: Services to check chassis power state and update chassis "on" target
Andrew Geissler4a0f3322017-07-20 10:28:34 -050024# - hard-off: Services to force an immediate power off of the chassis
Matthew Barth1851aa62018-01-10 09:16:28 -060025CHASSIS_ACTION_TARGETS = "poweron poweroff powered-off powerreset hard-poweroff"
Andrew Geissler997ed662017-03-05 20:36:50 -060026
27# Track all host synchronization point targets
Josh D. Kinga283e072017-04-06 15:56:37 -050028# - start-pre: Services to run before we start host boot
29# - starting: Services to run to do the host boot
30# - started: Services to run once the host is booted
31# - stop-pre,stopping,stopped: Same as above but applied to shutting down the host
32# - reset-running: Services to check if host is running after bmc reset
33HOST_SYNCH_TARGETS = "start-pre starting started stop-pre stopping stopped reset-running"
Andrew Geissler997ed662017-03-05 20:36:50 -060034
Andrew Geissler9ccc3662017-01-04 11:11:00 -060035# Track all host action targets
Andrew Geissler510ae372018-03-27 13:56:26 -070036# - start: Will run startmin target, this target used for any additional
37# services that user needs for an initial power on of host.
38# For example, resetting the host reboot count could be put in
39# this target so on any fresh power on, this count is reset.
40# - startmin: Minimum services required to start the host. This target will
41# be called by reboot and start target.
Josh D. King3c7a8ef2017-04-11 09:48:10 -050042# - stop: Services to run to shutdown the host
43# - quiesce: Target to enter on host boot failure
44# - shutdown: Tell host to shutdown, then stop system
Josh D. Kinga283e072017-04-06 15:56:37 -050045# - reset: Services to check if host is running and update host "start" target
Vishwanatha Subbanna49c4e502017-04-04 16:41:02 +053046# - crash: Target to run when host crashes. it is very much similar to
47# quiesce target but the only delta is that this target contains
48# multiple services and one of them is the quiesce target.
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053049# - timeout: Target to run when host watchdog times out
Andrew Geisslercd2b9462017-07-26 17:53:04 -050050# - reboot: Reboot the host
Andrew Geissler510ae372018-03-27 13:56:26 -070051HOST_ACTION_TARGETS = "start startmin stop quiesce reset shutdown crash timeout reboot"
Brad Bishope94b9152016-08-08 20:21:44 -040052
Josh D. Kinga283e072017-04-06 15:56:37 -050053CHASSIS_SYNCH_FMT = "obmc-power-{0}@.target"
Andrew Geissler4a0f3322017-07-20 10:28:34 -050054CHASSIS_ACTION_FMT = "obmc-chassis-{0}@.target"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060055HOST_SYNCH_FMT = "obmc-host-{0}@.target"
Josh D. Kinga283e072017-04-06 15:56:37 -050056HOST_ACTION_FMT = "obmc-host-{0}@.target"
Brad Bishope94b9152016-08-08 20:21:44 -040057
Josh D. Kinga283e072017-04-06 15:56:37 -050058CHASSIS_LINK_SYNCH_FMT = "${CHASSIS_SYNCH_FMT}:obmc-power-{0}@{1}.target"
Andrew Geissler4a0f3322017-07-20 10:28:34 -050059CHASSIS_LINK_ACTION_FMT = "${CHASSIS_ACTION_FMT}:obmc-chassis-{0}@{1}.target"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060060HOST_LINK_SYNCH_FMT = "${HOST_SYNCH_FMT}:obmc-host-{0}@{1}.target"
Josh D. Kinga283e072017-04-06 15:56:37 -050061HOST_LINK_ACTION_FMT = "${HOST_ACTION_FMT}:obmc-host-{0}@{1}.target"
Matt Spinler393c9b12017-05-16 11:57:20 -050062FAN_LINK_FMT = "obmc-fan-control-ready@.target:obmc-fan-control-ready@{0}.target"
Brad Bishope94b9152016-08-08 20:21:44 -040063
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053064# Targets to be executed on checkstop and watchdog timeout
65HOST_ERROR_TARGETS = "crash timeout"
66
Vishwanatha Subbanna49c4e502017-04-04 16:41:02 +053067QUIESCE_TMPL = "obmc-host-quiesce@.target"
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053068CRASH_TIMEOUT_TGTFMT = "obmc-host-{0}@{1}.target"
69QUIESCE_INSTFMT = "obmc-host-quiesce@{1}.target"
70QUIESCE_FMT = "../${QUIESCE_TMPL}:${CRASH_TIMEOUT_TGTFMT}.wants/${QUIESCE_INSTFMT}"
Vishwanatha Subbanna49c4e502017-04-04 16:41:02 +053071
Brad Bishope94b9152016-08-08 20:21:44 -040072SYSTEMD_SERVICE_${PN} += " \
73 obmc-mapper.target \
Brad Bishopd969da32016-08-30 00:21:14 -040074 obmc-webserver-pre.target \
Brad Bishope94b9152016-08-08 20:21:44 -040075 obmc-fans-ready.target \
76 obmc-fan-control.target \
Matt Spinler393c9b12017-05-16 11:57:20 -050077 obmc-fan-control-ready@.target \
Matt Spinler4c2af632017-06-08 12:20:07 -050078 obmc-fan-watchdog-takeover.target \
Brad Bishope94b9152016-08-08 20:21:44 -040079 obmc-standby.target \
80 "
81
Josh D. Kinga283e072017-04-06 15:56:37 -050082SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'CHASSIS_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS')}"
83SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'CHASSIS_ACTION_FMT', 'CHASSIS_ACTION_TARGETS')}"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060084SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'HOST_SYNCH_FMT', 'HOST_SYNCH_TARGETS')}"
85SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'HOST_ACTION_FMT', 'HOST_ACTION_TARGETS')}"
Brad Bishope94b9152016-08-08 20:21:44 -040086
Josh D. Kinga283e072017-04-06 15:56:37 -050087SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CHASSIS_LINK_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
88SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CHASSIS_LINK_ACTION_FMT', 'CHASSIS_ACTION_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060089SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_LINK_SYNCH_FMT', 'HOST_SYNCH_TARGETS', 'OBMC_HOST_INSTANCES')}"
90SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_LINK_ACTION_FMT', 'HOST_ACTION_TARGETS', 'OBMC_HOST_INSTANCES')}"
Matt Spinler393c9b12017-05-16 11:57:20 -050091SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FAN_LINK_FMT', 'OBMC_CHASSIS_INSTANCES')}"
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053092SYSTEMD_LINK_${PN} += "${@compose_list(d, 'QUIESCE_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"