blob: 3e217bc418400f8d2f52caaad99fba5b80eb7ef8 [file] [log] [blame]
Brad Bishope3060732016-08-08 20:21:44 -04001SUMMARY = "Phosphor Systemd targets"
2DESCRIPTION = "Provides well known Systemd syncronization points for OpenBMC."
3HOMEPAGE = "http://github.com/openbmc"
4PR = "r1"
5
6inherit obmc-phosphor-systemd
7inherit obmc-phosphor-license
8inherit allarch
9
Josh D. Kingefb04a12017-04-06 15:56:37 -050010# Chassis power synchronization targets
Andrew Geisslere4577f62017-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. Kingefb04a12017-04-06 15:56:37 -050016CHASSIS_SYNCH_TARGETS = "start-pre start on stop-pre stop off reset-on"
Andrew Geisslere4577f62017-03-05 20:36:50 -060017
Josh D. Kingefb04a12017-04-06 15:56:37 -050018# Chassis action power targets
Andrew Geisslere4577f62017-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
Andrew Geisslere4577f62017-03-05 20:36:50 -060021# - reset: Services to check chassis power state and update chassis "on" target
Josh D. Kingefb04a12017-04-06 15:56:37 -050022CHASSIS_ACTION_TARGETS = "on off reset"
Andrew Geisslere4577f62017-03-05 20:36:50 -060023
24# Track all host synchronization point targets
Josh D. Kingefb04a12017-04-06 15:56:37 -050025# - start-pre: Services to run before we start host boot
26# - starting: Services to run to do the host boot
27# - started: Services to run once the host is booted
28# - stop-pre,stopping,stopped: Same as above but applied to shutting down the host
29# - reset-running: Services to check if host is running after bmc reset
30HOST_SYNCH_TARGETS = "start-pre starting started stop-pre stopping stopped reset-running"
Andrew Geisslere4577f62017-03-05 20:36:50 -060031
Andrew Geisslerc91cfcb2017-01-04 11:11:00 -060032# Track all host action targets
Josh D. King75c38752017-04-11 09:48:10 -050033# - start: Service to run to start the host
34# - stop: Services to run to shutdown the host
35# - quiesce: Target to enter on host boot failure
36# - shutdown: Tell host to shutdown, then stop system
Josh D. Kingefb04a12017-04-06 15:56:37 -050037# - reset: Services to check if host is running and update host "start" target
Vishwanatha Subbanna1d22c222017-04-04 16:41:02 +053038# - crash: Target to run when host crashes. it is very much similar to
39# quiesce target but the only delta is that this target contains
40# multiple services and one of them is the quiesce target.
Vishwanatha Subbanna98e2ba32017-06-12 14:48:29 +053041# - timeout: Target to run when host watchdog times out
42HOST_ACTION_TARGETS = "start stop quiesce reset shutdown crash timeout"
Brad Bishope3060732016-08-08 20:21:44 -040043
Josh D. Kingefb04a12017-04-06 15:56:37 -050044CHASSIS_SYNCH_FMT = "obmc-power-{0}@.target"
45CHASSIS_ACTION_FMT = "obmc-chassis-power{0}@.target"
Andrew Geisslerc91cfcb2017-01-04 11:11:00 -060046HOST_SYNCH_FMT = "obmc-host-{0}@.target"
Josh D. Kingefb04a12017-04-06 15:56:37 -050047HOST_ACTION_FMT = "obmc-host-{0}@.target"
Brad Bishope3060732016-08-08 20:21:44 -040048
Josh D. Kingefb04a12017-04-06 15:56:37 -050049CHASSIS_LINK_SYNCH_FMT = "${CHASSIS_SYNCH_FMT}:obmc-power-{0}@{1}.target"
50CHASSIS_LINK_ACTION_FMT = "${CHASSIS_ACTION_FMT}:obmc-chassis-power{0}@{1}.target"
Andrew Geisslerc91cfcb2017-01-04 11:11:00 -060051HOST_LINK_SYNCH_FMT = "${HOST_SYNCH_FMT}:obmc-host-{0}@{1}.target"
Josh D. Kingefb04a12017-04-06 15:56:37 -050052HOST_LINK_ACTION_FMT = "${HOST_ACTION_FMT}:obmc-host-{0}@{1}.target"
Matt Spinler6a3b4be2017-05-16 11:57:20 -050053FAN_LINK_FMT = "obmc-fan-control-ready@.target:obmc-fan-control-ready@{0}.target"
Brad Bishope3060732016-08-08 20:21:44 -040054
Vishwanatha Subbanna98e2ba32017-06-12 14:48:29 +053055# Targets to be executed on checkstop and watchdog timeout
56HOST_ERROR_TARGETS = "crash timeout"
57
Vishwanatha Subbanna1d22c222017-04-04 16:41:02 +053058QUIESCE_TMPL = "obmc-host-quiesce@.target"
Vishwanatha Subbanna98e2ba32017-06-12 14:48:29 +053059CRASH_TIMEOUT_TGTFMT = "obmc-host-{0}@{1}.target"
60QUIESCE_INSTFMT = "obmc-host-quiesce@{1}.target"
61QUIESCE_FMT = "../${QUIESCE_TMPL}:${CRASH_TIMEOUT_TGTFMT}.wants/${QUIESCE_INSTFMT}"
Vishwanatha Subbanna1d22c222017-04-04 16:41:02 +053062
Brad Bishope3060732016-08-08 20:21:44 -040063SYSTEMD_SERVICE_${PN} += " \
64 obmc-mapper.target \
Brad Bishop4bd27732016-08-30 00:21:14 -040065 obmc-webserver-pre.target \
Brad Bishope3060732016-08-08 20:21:44 -040066 obmc-fans-ready.target \
67 obmc-fan-control.target \
Matt Spinler6a3b4be2017-05-16 11:57:20 -050068 obmc-fan-control-ready@.target \
Matt Spinler00714a42017-06-08 12:20:07 -050069 obmc-fan-watchdog-takeover.target \
Brad Bishope3060732016-08-08 20:21:44 -040070 obmc-standby.target \
71 "
72
Josh D. Kingefb04a12017-04-06 15:56:37 -050073SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'CHASSIS_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS')}"
74SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'CHASSIS_ACTION_FMT', 'CHASSIS_ACTION_TARGETS')}"
Andrew Geisslerc91cfcb2017-01-04 11:11:00 -060075SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'HOST_SYNCH_FMT', 'HOST_SYNCH_TARGETS')}"
76SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'HOST_ACTION_FMT', 'HOST_ACTION_TARGETS')}"
Brad Bishope3060732016-08-08 20:21:44 -040077
Josh D. Kingefb04a12017-04-06 15:56:37 -050078SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CHASSIS_LINK_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
79SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CHASSIS_LINK_ACTION_FMT', 'CHASSIS_ACTION_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
Andrew Geisslerc91cfcb2017-01-04 11:11:00 -060080SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_LINK_SYNCH_FMT', 'HOST_SYNCH_TARGETS', 'OBMC_HOST_INSTANCES')}"
81SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_LINK_ACTION_FMT', 'HOST_ACTION_TARGETS', 'OBMC_HOST_INSTANCES')}"
Matt Spinler6a3b4be2017-05-16 11:57:20 -050082SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FAN_LINK_FMT', 'OBMC_CHASSIS_INSTANCES')}"
Vishwanatha Subbanna98e2ba32017-06-12 14:48:29 +053083SYSTEMD_LINK_${PN} += "${@compose_list(d, 'QUIESCE_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"