move chassis power services to phosphor-state-manager
Move the generic services which are used to power on and off the chassis
into phosphor-state-manager. This will make the use of
phosphor-state-manager for chassis power control more straightforward.
These services are directly copied from openbmc/openbmc/
meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/ and
renamed to match with the existing naming conventions.
The only change to these files was if a Wants/Before/After service name
was changing as a part of this.
A follow on commit will improve some of the Description fields.
The following email has more details on this change:
https://lists.ozlabs.org/pipermail/openbmc/2022-November/032457.html
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I35d555139897cf58a26e36d1558ab7f5225d34bd
diff --git a/service_files/obmc-power-start@.service b/service_files/obmc-power-start@.service
new file mode 100644
index 0000000..10d4a3b
--- /dev/null
+++ b/service_files/obmc-power-start@.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Start Power%i
+Wants=obmc-power-start@%i.target
+Before=obmc-power-start@%i.target
+Wants=obmc-power-start-pre@%i.target
+After=obmc-power-start-pre@%i.target
+After=obmc-fan-control.target
+Wants=mapper-wait@-org-openbmc-control-power%i.service
+After=mapper-wait@-org-openbmc-control-power%i.service
+Conflicts=obmc-chassis-poweroff@%i.target
+ConditionPathExists=!/run/openbmc/chassis@%i-on
+
+[Service]
+RemainAfterExit=yes
+Type=oneshot
+ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/power%i` /org/openbmc/control/power%i org.openbmc.control.Power setPowerState i 1"
+SyslogIdentifier=phosphor-power-start
+
+[Install]
+WantedBy=obmc-host-start@%i.target