From 6be4a2c7016d22fdc4b7894e1225beb53cb00975 Mon Sep 17 00:00:00 2001 From: Lei YU Date: Wed, 1 Aug 2018 14:02:26 +0800 Subject: 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 --- .../state/files/obmc/phosphor-reboot-host/reboot.conf | 1 + .../common/recipes-phosphor/state/files/phosphor-reboot-host@.service | 4 ++-- meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 meta-phosphor/common/recipes-phosphor/state/files/obmc/phosphor-reboot-host/reboot.conf (limited to 'meta-phosphor') 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" -- cgit v1.2.3