diff options
author | Andrew Geissler <geissonator@yahoo.com> | 2018-03-27 19:39:05 -0700 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-04-06 00:44:56 +0000 |
commit | ec7f920602218b6a6cb17f2850ff3fdfe77158b0 (patch) | |
tree | 91e5464999cf28c4c071e6d224ad6619d06fa883 /meta-phosphor | |
parent | 5c76e0cf9f742cae4156c30c033af50be1135ab7 (diff) | |
download | talos-openbmc-ec7f920602218b6a6cb17f2850ff3fdfe77158b0.tar.gz talos-openbmc-ec7f920602218b6a6cb17f2850ff3fdfe77158b0.zip |
Reset host reboot attempts on fresh boot
The host reboot attempts counter is used to ensure
the host is only allowed a certain amount of retries to
boot for any given boot request. The count should be reset,
and the host should be given it's full amount of tries, on
any fresh boot request.
This commit puts a service into the host-start target which
is only called on a fresh boot request.
Tested: Verified this new service is run on fresh boot requests
and is not run on host reboot requests.
Resolves openbmc/openbmc#3035
Change-Id: I4be327e57d6f835b19e47272ceaad796196b68c5
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-phosphor')
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-reboot-attempts@.service | 13 | ||||
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-reboot-attempts@.service b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-reboot-attempts@.service new file mode 100644 index 000000000..35de4304b --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-reboot-attempts@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Reset host reboot counter +Wants=mapper-wait@-xyz-openbmc_project-state-host%i.service +After=mapper-wait@-xyz-openbmc_project-state-host%i.service +ConditionPathExists=!/run/openbmc/host@%i-on + +[Service] +Restart=no +Type=oneshot +ExecStart=/bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/state/host%i` /xyz/openbmc_project/state/host%i xyz.openbmc_project.Control.Boot.RebootAttempts AttemptsLeft u 3" + +[Install] +WantedBy=obmc-host-start@%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 993615651..0aefebb91 100644 --- a/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb +++ b/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb @@ -54,6 +54,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_SERVICE_${PN}-host += "phosphor-reset-host-reboot-attempts@.service" FILES_${PN}-chassis = "${sbindir}/phosphor-chassis-state-manager" DBUS_SERVICE_${PN}-chassis += "xyz.openbmc_project.State.Chassis.service" @@ -129,6 +130,12 @@ HOST_STARTMIN_INSTFMT = "obmc-host-startmin@{0}.target" HOST_START_FMT = "../${HOST_STARTMIN_TMPL}:${HOST_START_TGTFMT}.requires/${HOST_STARTMIN_INSTFMT}" SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_START_FMT', 'OBMC_HOST_INSTANCES')}" +# Force the host-start target to call the reboot count reset service +HOST_RST_RBT_ATTEMPTS_SVC = "phosphor-reset-host-reboot-attempts@.service" +HOST_RST_RBT_ATTEMPTS_SVC_INST = "phosphor-reset-host-reboot-attempts@{0}.service" +HOST_RST_RBT_ATTEMPTS_SVC_FMT = "../${HOST_RST_RBT_ATTEMPTS_SVC}:${HOST_START_TGTFMT}.requires/${HOST_RST_RBT_ATTEMPTS_SVC_INST}" +SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_RST_RBT_ATTEMPTS_SVC_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}" + SRC_URI += "git://github.com/openbmc/phosphor-state-manager" SRCREV = "969b2613fed44f5b504411b21a9c65d89ed28bf5" |