blob: ac7835e6bf2d7cfa6b33fdc8c86b4dc8f5fb3828 [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"
5
6inherit obmc-phosphor-systemd
7inherit obmc-phosphor-license
8inherit allarch
9
Josh D. Kinga283e072017-04-06 15:56:37 -050010# Chassis power synchronization targets
Andrew Geissler997ed662017-03-05 20:36:50 -060011# - start-pre: Services to run before we start power on process
12# - start: Services to run to do the chassis power on
13# - on: Services to run once power is on
14# - stop-pre,stop,off: Same as above but applied to powering off
15# - reset-on: Services to check if chassis power is on after bmc reset
Josh D. Kinga283e072017-04-06 15:56:37 -050016CHASSIS_SYNCH_TARGETS = "start-pre start on stop-pre stop off reset-on"
Andrew Geissler997ed662017-03-05 20:36:50 -060017
Josh D. Kinga283e072017-04-06 15:56:37 -050018# Chassis action power targets
Andrew Geissler997ed662017-03-05 20:36:50 -060019# - on: Services to run to power on the chassis
20# - off: Services to run to power off the chassis
Matthew Barth1851aa62018-01-10 09:16:28 -060021# - powered-off: Services to run once chassis power is off
Andrew Geissler997ed662017-03-05 20:36:50 -060022# - reset: Services to check chassis power state and update chassis "on" target
Andrew Geissler4a0f3322017-07-20 10:28:34 -050023# - hard-off: Services to force an immediate power off of the chassis
Matthew Barth1851aa62018-01-10 09:16:28 -060024CHASSIS_ACTION_TARGETS = "poweron poweroff powered-off powerreset hard-poweroff"
Andrew Geissler997ed662017-03-05 20:36:50 -060025
26# Track all host synchronization point targets
Josh D. Kinga283e072017-04-06 15:56:37 -050027# - start-pre: Services to run before we start host boot
28# - starting: Services to run to do the host boot
29# - started: Services to run once the host is booted
30# - stop-pre,stopping,stopped: Same as above but applied to shutting down the host
31# - reset-running: Services to check if host is running after bmc reset
32HOST_SYNCH_TARGETS = "start-pre starting started stop-pre stopping stopped reset-running"
Andrew Geissler997ed662017-03-05 20:36:50 -060033
Andrew Geissler9ccc3662017-01-04 11:11:00 -060034# Track all host action targets
Andrew Geissler510ae372018-03-27 13:56:26 -070035# - start: Will run startmin target, this target used for any additional
36# services that user needs for an initial power on of host.
37# For example, resetting the host reboot count could be put in
38# this target so on any fresh power on, this count is reset.
39# - startmin: Minimum services required to start the host. This target will
40# be called by reboot and start target.
Josh D. King3c7a8ef2017-04-11 09:48:10 -050041# - stop: Services to run to shutdown the host
42# - quiesce: Target to enter on host boot failure
43# - shutdown: Tell host to shutdown, then stop system
Josh D. Kinga283e072017-04-06 15:56:37 -050044# - reset: Services to check if host is running and update host "start" target
Vishwanatha Subbanna49c4e502017-04-04 16:41:02 +053045# - crash: Target to run when host crashes. it is very much similar to
46# quiesce target but the only delta is that this target contains
47# multiple services and one of them is the quiesce target.
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053048# - timeout: Target to run when host watchdog times out
Andrew Geisslercd2b9462017-07-26 17:53:04 -050049# - reboot: Reboot the host
Andrew Geissler510ae372018-03-27 13:56:26 -070050HOST_ACTION_TARGETS = "start startmin stop quiesce reset shutdown crash timeout reboot"
Brad Bishope94b9152016-08-08 20:21:44 -040051
Josh D. Kinga283e072017-04-06 15:56:37 -050052CHASSIS_SYNCH_FMT = "obmc-power-{0}@.target"
Andrew Geissler4a0f3322017-07-20 10:28:34 -050053CHASSIS_ACTION_FMT = "obmc-chassis-{0}@.target"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060054HOST_SYNCH_FMT = "obmc-host-{0}@.target"
Josh D. Kinga283e072017-04-06 15:56:37 -050055HOST_ACTION_FMT = "obmc-host-{0}@.target"
Brad Bishope94b9152016-08-08 20:21:44 -040056
Josh D. Kinga283e072017-04-06 15:56:37 -050057CHASSIS_LINK_SYNCH_FMT = "${CHASSIS_SYNCH_FMT}:obmc-power-{0}@{1}.target"
Andrew Geissler4a0f3322017-07-20 10:28:34 -050058CHASSIS_LINK_ACTION_FMT = "${CHASSIS_ACTION_FMT}:obmc-chassis-{0}@{1}.target"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060059HOST_LINK_SYNCH_FMT = "${HOST_SYNCH_FMT}:obmc-host-{0}@{1}.target"
Josh D. Kinga283e072017-04-06 15:56:37 -050060HOST_LINK_ACTION_FMT = "${HOST_ACTION_FMT}:obmc-host-{0}@{1}.target"
Matt Spinler393c9b12017-05-16 11:57:20 -050061FAN_LINK_FMT = "obmc-fan-control-ready@.target:obmc-fan-control-ready@{0}.target"
Brad Bishope94b9152016-08-08 20:21:44 -040062
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053063# Targets to be executed on checkstop and watchdog timeout
64HOST_ERROR_TARGETS = "crash timeout"
65
Vishwanatha Subbanna49c4e502017-04-04 16:41:02 +053066QUIESCE_TMPL = "obmc-host-quiesce@.target"
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053067CRASH_TIMEOUT_TGTFMT = "obmc-host-{0}@{1}.target"
68QUIESCE_INSTFMT = "obmc-host-quiesce@{1}.target"
69QUIESCE_FMT = "../${QUIESCE_TMPL}:${CRASH_TIMEOUT_TGTFMT}.wants/${QUIESCE_INSTFMT}"
Vishwanatha Subbanna49c4e502017-04-04 16:41:02 +053070
Brad Bishope94b9152016-08-08 20:21:44 -040071SYSTEMD_SERVICE_${PN} += " \
72 obmc-mapper.target \
Brad Bishopd969da32016-08-30 00:21:14 -040073 obmc-webserver-pre.target \
Brad Bishope94b9152016-08-08 20:21:44 -040074 obmc-fans-ready.target \
75 obmc-fan-control.target \
Matt Spinler393c9b12017-05-16 11:57:20 -050076 obmc-fan-control-ready@.target \
Matt Spinler4c2af632017-06-08 12:20:07 -050077 obmc-fan-watchdog-takeover.target \
Brad Bishope94b9152016-08-08 20:21:44 -040078 obmc-standby.target \
79 "
80
Josh D. Kinga283e072017-04-06 15:56:37 -050081SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'CHASSIS_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS')}"
82SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'CHASSIS_ACTION_FMT', 'CHASSIS_ACTION_TARGETS')}"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060083SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'HOST_SYNCH_FMT', 'HOST_SYNCH_TARGETS')}"
84SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'HOST_ACTION_FMT', 'HOST_ACTION_TARGETS')}"
Brad Bishope94b9152016-08-08 20:21:44 -040085
Josh D. Kinga283e072017-04-06 15:56:37 -050086SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CHASSIS_LINK_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
87SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CHASSIS_LINK_ACTION_FMT', 'CHASSIS_ACTION_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060088SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_LINK_SYNCH_FMT', 'HOST_SYNCH_TARGETS', 'OBMC_HOST_INSTANCES')}"
89SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_LINK_ACTION_FMT', 'HOST_ACTION_TARGETS', 'OBMC_HOST_INSTANCES')}"
Matt Spinler393c9b12017-05-16 11:57:20 -050090SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FAN_LINK_FMT', 'OBMC_CHASSIS_INSTANCES')}"
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053091SYSTEMD_LINK_${PN} += "${@compose_list(d, 'QUIESCE_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"