blob: c3bcd73e12a4cd53233fc5b2968c8f5142053a09 [file] [log] [blame]
Brad Bishope94b9152016-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. 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
Andrew Geissler997ed662017-03-05 20:36:50 -060021# - reset: Services to check chassis power state and update chassis "on" target
Andrew Geissler4a0f3322017-07-20 10:28:34 -050022# - hard-off: Services to force an immediate power off of the chassis
23CHASSIS_ACTION_TARGETS = "poweron poweroff powerreset hard-poweroff"
Andrew Geissler997ed662017-03-05 20:36:50 -060024
25# Track all host synchronization point targets
Josh D. Kinga283e072017-04-06 15:56:37 -050026# - start-pre: Services to run before we start host boot
27# - starting: Services to run to do the host boot
28# - started: Services to run once the host is booted
29# - stop-pre,stopping,stopped: Same as above but applied to shutting down the host
30# - reset-running: Services to check if host is running after bmc reset
31HOST_SYNCH_TARGETS = "start-pre starting started stop-pre stopping stopped reset-running"
Andrew Geissler997ed662017-03-05 20:36:50 -060032
Andrew Geissler9ccc3662017-01-04 11:11:00 -060033# Track all host action targets
Josh D. King3c7a8ef2017-04-11 09:48:10 -050034# - start: Service to run to start the host
35# - stop: Services to run to shutdown the host
36# - quiesce: Target to enter on host boot failure
37# - shutdown: Tell host to shutdown, then stop system
Josh D. Kinga283e072017-04-06 15:56:37 -050038# - reset: Services to check if host is running and update host "start" target
Vishwanatha Subbanna49c4e502017-04-04 16:41:02 +053039# - crash: Target to run when host crashes. it is very much similar to
40# quiesce target but the only delta is that this target contains
41# multiple services and one of them is the quiesce target.
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053042# - timeout: Target to run when host watchdog times out
Andrew Geisslercd2b9462017-07-26 17:53:04 -050043# - reboot: Reboot the host
44HOST_ACTION_TARGETS = "start stop quiesce reset shutdown crash timeout reboot"
Brad Bishope94b9152016-08-08 20:21:44 -040045
Josh D. Kinga283e072017-04-06 15:56:37 -050046CHASSIS_SYNCH_FMT = "obmc-power-{0}@.target"
Andrew Geissler4a0f3322017-07-20 10:28:34 -050047CHASSIS_ACTION_FMT = "obmc-chassis-{0}@.target"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060048HOST_SYNCH_FMT = "obmc-host-{0}@.target"
Josh D. Kinga283e072017-04-06 15:56:37 -050049HOST_ACTION_FMT = "obmc-host-{0}@.target"
Brad Bishope94b9152016-08-08 20:21:44 -040050
Josh D. Kinga283e072017-04-06 15:56:37 -050051CHASSIS_LINK_SYNCH_FMT = "${CHASSIS_SYNCH_FMT}:obmc-power-{0}@{1}.target"
Andrew Geissler4a0f3322017-07-20 10:28:34 -050052CHASSIS_LINK_ACTION_FMT = "${CHASSIS_ACTION_FMT}:obmc-chassis-{0}@{1}.target"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060053HOST_LINK_SYNCH_FMT = "${HOST_SYNCH_FMT}:obmc-host-{0}@{1}.target"
Josh D. Kinga283e072017-04-06 15:56:37 -050054HOST_LINK_ACTION_FMT = "${HOST_ACTION_FMT}:obmc-host-{0}@{1}.target"
Matt Spinler393c9b12017-05-16 11:57:20 -050055FAN_LINK_FMT = "obmc-fan-control-ready@.target:obmc-fan-control-ready@{0}.target"
Brad Bishope94b9152016-08-08 20:21:44 -040056
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053057# Targets to be executed on checkstop and watchdog timeout
58HOST_ERROR_TARGETS = "crash timeout"
59
Vishwanatha Subbanna49c4e502017-04-04 16:41:02 +053060QUIESCE_TMPL = "obmc-host-quiesce@.target"
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053061CRASH_TIMEOUT_TGTFMT = "obmc-host-{0}@{1}.target"
62QUIESCE_INSTFMT = "obmc-host-quiesce@{1}.target"
63QUIESCE_FMT = "../${QUIESCE_TMPL}:${CRASH_TIMEOUT_TGTFMT}.wants/${QUIESCE_INSTFMT}"
Vishwanatha Subbanna49c4e502017-04-04 16:41:02 +053064
Brad Bishope94b9152016-08-08 20:21:44 -040065SYSTEMD_SERVICE_${PN} += " \
66 obmc-mapper.target \
Brad Bishopd969da32016-08-30 00:21:14 -040067 obmc-webserver-pre.target \
Brad Bishope94b9152016-08-08 20:21:44 -040068 obmc-fans-ready.target \
69 obmc-fan-control.target \
Matt Spinler393c9b12017-05-16 11:57:20 -050070 obmc-fan-control-ready@.target \
Matt Spinler4c2af632017-06-08 12:20:07 -050071 obmc-fan-watchdog-takeover.target \
Brad Bishope94b9152016-08-08 20:21:44 -040072 obmc-standby.target \
73 "
74
Josh D. Kinga283e072017-04-06 15:56:37 -050075SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'CHASSIS_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS')}"
76SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'CHASSIS_ACTION_FMT', 'CHASSIS_ACTION_TARGETS')}"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060077SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'HOST_SYNCH_FMT', 'HOST_SYNCH_TARGETS')}"
78SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'HOST_ACTION_FMT', 'HOST_ACTION_TARGETS')}"
Brad Bishope94b9152016-08-08 20:21:44 -040079
Josh D. Kinga283e072017-04-06 15:56:37 -050080SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CHASSIS_LINK_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
81SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CHASSIS_LINK_ACTION_FMT', 'CHASSIS_ACTION_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
Andrew Geissler9ccc3662017-01-04 11:11:00 -060082SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_LINK_SYNCH_FMT', 'HOST_SYNCH_TARGETS', 'OBMC_HOST_INSTANCES')}"
83SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_LINK_ACTION_FMT', 'HOST_ACTION_TARGETS', 'OBMC_HOST_INSTANCES')}"
Matt Spinler393c9b12017-05-16 11:57:20 -050084SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FAN_LINK_FMT', 'OBMC_CHASSIS_INSTANCES')}"
Vishwanatha Subbannafad09562017-06-12 14:48:29 +053085SYSTEMD_LINK_${PN} += "${@compose_list(d, 'QUIESCE_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"