diff options
author | Lei YU <mine260309@gmail.com> | 2018-08-01 09:02:26 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2018-08-08 15:27:53 +0300 |
commit | 6be4a2c7016d22fdc4b7894e1225beb53cb00975 (patch) | |
tree | b1f8c3c09bcede3887c12af6b12019bacf8d2c16 | |
parent | 3a019552f9d0d45fbd00e0212dd961eb822cdafb (diff) | |
download | openbmc-6be4a2c7016d22fdc4b7894e1225beb53cb00975.tar.xz |
phosphor-reboot-host: Use environment file for sleep
By default phosphor-reboot-host@.service sleeps for 5 seconds between
power off and power on.
Make the sleep time as configurable parameter in environment, so
different machines could use different sleep time.
Tested: Verify the sleep time is from the config file.
Change-Id: I81d17e56010fe595dd46295923746f8678678209
Signed-off-by: Lei YU <mine260309@gmail.com>
3 files changed, 4 insertions, 2 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/state/files/obmc/phosphor-reboot-host/reboot.conf b/meta-phosphor/common/recipes-phosphor/state/files/obmc/phosphor-reboot-host/reboot.conf new file mode 100644 index 000000000..2e3ca1a5b --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/state/files/obmc/phosphor-reboot-host/reboot.conf @@ -0,0 +1 @@ +REBOOT_DELAY=5 diff --git a/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reboot-host@.service b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reboot-host@.service index 6158086e1..27479f2de 100644 --- a/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reboot-host@.service +++ b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reboot-host@.service @@ -11,8 +11,8 @@ After=obmc-host-stop@%i.target # solution does the job. # Since this is a part of the reboot target, call the startmin # target which does the minimum required to start the host. -ExecStart=/bin/sh -c "sleep 5 && systemctl start obmc-host-startmin@%i.target" - +ExecStart=/bin/sh -c "sleep ${{REBOOT_DELAY}} && systemctl start obmc-host-startmin@%i.target" +EnvironmentFile={envfiledir}/obmc/phosphor-reboot-host/reboot.conf [Install] WantedBy=obmc-host-reboot@%i.target diff --git a/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb b/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb index 4c642dd13..0b974c275 100644 --- a/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb +++ b/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb @@ -52,6 +52,7 @@ RDEPENDS_${PN}-reset-sensor-states += "libsystemd phosphor-dbus-interfaces" FILES_${PN}-host = "${sbindir}/phosphor-host-state-manager" DBUS_SERVICE_${PN}-host += "xyz.openbmc_project.State.Host.service" DBUS_SERVICE_${PN}-host += "phosphor-reboot-host@.service" +SYSTEMD_ENVIRONMENT_FILE_${PN}-host += "obmc/phosphor-reboot-host/reboot.conf" SYSTEMD_SERVICE_${PN}-host += "phosphor-reset-host-reboot-attempts@.service" FILES_${PN}-chassis = "${sbindir}/phosphor-chassis-state-manager" |