summaryrefslogtreecommitdiffstats
path: root/meta-phosphor/common/recipes-core
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2016-08-08 20:21:44 -0400
committerPatrick Williams <patrick@stwcx.xyz>2016-09-06 11:13:37 +0000
commite306073ce2b779de139b943ca2e77ba888f2596e (patch)
tree6777ac10bf3197b8e7b31b765243edc00f69ae87 /meta-phosphor/common/recipes-core
parentef61b60c583e85287f1cb893c4aaaf6f5ab7f130 (diff)
downloadtalos-openbmc-e306073ce2b779de139b943ca2e77ba888f2596e.tar.gz
talos-openbmc-e306073ce2b779de139b943ca2e77ba888f2596e.zip
systemd: Add syncronization points for OpenBMC
Add systemd syncronization targets to facilitate expressing ordering dependencies. Change-Id: I11d4fb2b8ade8d3ae74ddea44585153e2f59130f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/common/recipes-core')
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets.bb35
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-chassis-start@.target8
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-chassis-stop@.target8
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-fan-control.target4
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-fans-ready.target4
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-start-pre@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-start@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-started@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stop-pre@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stop@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stopped@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-mapper.target4
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-off@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-on@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-start-pre@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-start@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-stop-pre@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-stop@.target7
-rw-r--r--meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-standby.target9
-rw-r--r--meta-phosphor/common/recipes-core/systemd/systemd/obmc-standby.target2
-rw-r--r--meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend6
21 files changed, 157 insertions, 7 deletions
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets.bb b/meta-phosphor/common/recipes-core/systemd/obmc-targets.bb
new file mode 100644
index 000000000..a75e989ed
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Phosphor Systemd targets"
+DESCRIPTION = "Provides well known Systemd syncronization points for OpenBMC."
+HOMEPAGE = "http://github.com/openbmc"
+PR = "r1"
+
+inherit obmc-phosphor-systemd
+inherit obmc-phosphor-license
+inherit allarch
+
+CHASSIS_TARGETS = "start stop"
+POWER_TARGETS = "start-pre start on stop-pre stop off"
+HOST_TARGETS = "start-pre start started stop-pre stop stopped"
+
+CHASSIS_FMT = "obmc-chassis-{0}@.target"
+POWER_FMT = "obmc-power-{0}@.target"
+HOST_FMT = "obmc-host-{0}@.target"
+
+CHASSIS_LINK_FMT = "${CHASSIS_FMT}:obmc-chassis-{0}@{1}.target"
+POWER_LINK_FMT = "${POWER_FMT}:obmc-power-{0}@{1}.target"
+HOST_LINK_FMT = "${HOST_FMT}:obmc-host-{0}@{1}.target"
+
+SYSTEMD_SERVICE_${PN} += " \
+ obmc-mapper.target \
+ obmc-fans-ready.target \
+ obmc-fan-control.target \
+ obmc-standby.target \
+ "
+
+SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'CHASSIS_FMT', 'CHASSIS_TARGETS')}"
+SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'POWER_FMT', 'POWER_TARGETS')}"
+SYSTEMD_SERVICE_${PN} += "${@compose_list(d, 'HOST_FMT', 'HOST_TARGETS')}"
+
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CHASSIS_LINK_FMT', 'CHASSIS_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'POWER_LINK_FMT', 'POWER_TARGETS', 'OBMC_POWER_INSTANCES')}"
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_LINK_FMT', 'HOST_TARGETS', 'OBMC_HOST_INSTANCES')}"
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-chassis-start@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-chassis-start@.target
new file mode 100644
index 000000000..c8eda8ab8
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-chassis-start@.target
@@ -0,0 +1,8 @@
+[Unit]
+Description=Chassis%i (Start)
+Wants={SYSTEMD_DEFAULT_TARGET}
+After={SYSTEMD_DEFAULT_TARGET}
+Wants=mapper-wait@-org-openbmc-control-chassis%i.service
+After=mapper-wait@-org-openbmc-control-chassis%i.service
+Conflicts=obmc-chassis-stop@%i.target
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-chassis-stop@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-chassis-stop@.target
new file mode 100644
index 000000000..aeac3d66d
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-chassis-stop@.target
@@ -0,0 +1,8 @@
+[Unit]
+Description=Chassis%i (Stop)
+Wants={SYSTEMD_DEFAULT_TARGET}
+After={SYSTEMD_DEFAULT_TARGET}
+Wants=mapper-wait@-org-openbmc-control-chassis%i.service
+After=mapper-wait@-org-openbmc-control-chassis%i.service
+Conflicts=obmc-chassis-start@%i.target
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-fan-control.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-fan-control.target
new file mode 100644
index 000000000..50665db4a
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-fan-control.target
@@ -0,0 +1,4 @@
+[Unit]
+Description=Fan Control
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-fans-ready.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-fans-ready.target
new file mode 100644
index 000000000..59e61c626
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-fans-ready.target
@@ -0,0 +1,4 @@
+[Unit]
+Description=Fans Ready
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-start-pre@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-start-pre@.target
new file mode 100644
index 000000000..d555d0a88
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-start-pre@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Start Host%i (Pre)
+Wants={SYSTEMD_DEFAULT_TARGET}
+After={SYSTEMD_DEFAULT_TARGET}
+Conflicts=obmc-chassis-stop@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-start@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-start@.target
new file mode 100644
index 000000000..5d309d2d3
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-start@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Start Host%i
+Wants={SYSTEMD_DEFAULT_TARGET}
+After=obmc-host-start-pre@%i.target
+Conflicts=obmc-chassis-stop@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-started@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-started@.target
new file mode 100644
index 000000000..fcae6e968
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-started@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Host%i (Started)
+Wants={SYSTEMD_DEFAULT_TARGET}
+After=obmc-host-start@%i.target
+Conflicts=obmc-chassis-stop@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stop-pre@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stop-pre@.target
new file mode 100644
index 000000000..a97925087
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stop-pre@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Stop Host%i (Pre)
+Wants={SYSTEMD_DEFAULT_TARGET}
+After={SYSTEMD_DEFAULT_TARGET}
+Conflicts=obmc-chassis-start@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stop@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stop@.target
new file mode 100644
index 000000000..c573e9c5b
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stop@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Stop Host%i
+Wants={SYSTEMD_DEFAULT_TARGET}
+After=obmc-host-stop-pre@%i.target
+Conflicts=obmc-chassis-start@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stopped@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stopped@.target
new file mode 100644
index 000000000..92afdf00f
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-host-stopped@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Host%i (Stopped)
+Wants={SYSTEMD_DEFAULT_TARGET}
+After=obmc-host-stop@%i.target
+Conflicts=obmc-chassis-start@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-mapper.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-mapper.target
new file mode 100644
index 000000000..5e52f4cd5
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-mapper.target
@@ -0,0 +1,4 @@
+[Unit]
+Description=Phosphor Object Mapper
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-off@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-off@.target
new file mode 100644
index 000000000..bd4f8c9a3
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-off@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Power%i (Off)
+Wants={SYSTEMD_DEFAULT_TARGET}
+After=obmc-power-stop@%i.target
+Conflicts=obmc-chassis-start@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-on@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-on@.target
new file mode 100644
index 000000000..c891173a5
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-on@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Power%i (On)
+Wants={SYSTEMD_DEFAULT_TARGET}
+After=obmc-power-start@%i.target
+Conflicts=obmc-chassis-stop@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-start-pre@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-start-pre@.target
new file mode 100644
index 000000000..2891e79da
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-start-pre@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Power%i On (Pre)
+Wants={SYSTEMD_DEFAULT_TARGET}
+After={SYSTEMD_DEFAULT_TARGET}
+Conflicts=obmc-chassis-stop@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-start@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-start@.target
new file mode 100644
index 000000000..d23c5e93a
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-start@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Power%i On
+After=obmc-power-start-pre@%i.target
+Wants={SYSTEMD_DEFAULT_TARGET}
+Conflicts=obmc-chassis-stop@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-stop-pre@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-stop-pre@.target
new file mode 100644
index 000000000..db625b33e
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-stop-pre@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Power%i Off (Pre)
+Wants={SYSTEMD_DEFAULT_TARGET}
+After={SYSTEMD_DEFAULT_TARGET}
+Conflicts=obmc-chassis-start@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-stop@.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-stop@.target
new file mode 100644
index 000000000..d7dd12562
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-power-stop@.target
@@ -0,0 +1,7 @@
+[Unit]
+Description=Power%i Off
+After=obmc-power-stop-pre@%i.target
+Wants={SYSTEMD_DEFAULT_TARGET}
+Conflicts=obmc-chassis-start@%i.target
+RefuseManualStart=yes
+RefuseManualStop=yes
diff --git a/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-standby.target b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-standby.target
new file mode 100644
index 000000000..95044a404
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/systemd/obmc-targets/obmc-standby.target
@@ -0,0 +1,9 @@
+[Unit]
+Description=Phosphor System - Standby
+Requires=multi-user.target
+RefuseManualStart=yes
+RefuseManualStop=yes
+AllowIsolate=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-phosphor/common/recipes-core/systemd/systemd/obmc-standby.target b/meta-phosphor/common/recipes-core/systemd/systemd/obmc-standby.target
deleted file mode 100644
index d8cd72f04..000000000
--- a/meta-phosphor/common/recipes-core/systemd/systemd/obmc-standby.target
+++ /dev/null
@@ -1,2 +0,0 @@
-[Unit]
-Description=OpenBMC System
diff --git a/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend b/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend
index 0fd2931e1..54ea26a15 100644
--- a/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend
+++ b/meta-phosphor/common/recipes-core/systemd/systemd_%.bbappend
@@ -2,19 +2,15 @@ PACKAGECONFIG_append = " networkd"
PACKAGECONFIG_remove = "machined hibernate ldconfig binfmt backlight quotacheck localed kdbus ima smack polkit"
FILESEXTRAPATHS_append := "${THISDIR}/${PN}:"
SRC_URI += "file://default.network"
-SRC_URI += "file://obmc-standby.target"
SRC_URI += "file://0001-Export-message_append_cmdline.patch"
+RRECOMMENDS_${PN} += "obmc-targets"
FILES_${PN} += "${libdir}/systemd/network/default.network"
-FILES_${PN} += "${systemd_system_unitdir}/obmc-standby.target"
EXTRA_OECONF += " --disable-hwdb"
do_install_append() {
install -m 644 ${WORKDIR}/default.network ${D}${libdir}/systemd/network/
- install -m 644 ${WORKDIR}/obmc-standby.target ${D}${systemd_system_unitdir}
- ln -sf ../obmc-standby.target \
- ${D}${systemd_system_unitdir}/multi-user.target.wants/obmc-standby.target
#TODO Remove after this issue is resolved
#https://github.com/openbmc/openbmc/issues/152
OpenPOWER on IntegriCloud