diff options
| author | Adriana Kobylak <anoo@us.ibm.com> | 2018-04-09 14:24:06 -0500 |
|---|---|---|
| committer | Adriana Kobylak <anoo@us.ibm.com> | 2018-04-09 14:25:09 -0500 |
| commit | 166bdf3a60359e853919d90cd3d95f890d9f788b (patch) | |
| tree | d8c910adc00ad3238c751dc1fd77b8b3acd879f3 | |
| parent | e24fd6f7deadddc2867b2c417590da0ff093e5e2 (diff) | |
| download | phosphor-bmc-code-mgmt-166bdf3a60359e853919d90cd3d95f890d9f788b.tar.gz phosphor-bmc-code-mgmt-166bdf3a60359e853919d90cd3d95f890d9f788b.zip | |
Revert "Revert "Wait for obmc-flash-bmc-updateubootvars@.service""
This reverts commit e24fd6f7deadddc2867b2c417590da0ff093e5e2.
The code that waits for the service file to complete causes
intermittent issues, so will be reverted.
Change-Id: I830f8a2e4914694889c3626bb67bd1fe422e984d
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
| -rw-r--r-- | activation.cpp | 56 | ||||
| -rw-r--r-- | activation.hpp | 4 |
2 files changed, 40 insertions, 20 deletions
diff --git a/activation.cpp b/activation.cpp index dbfe030..ee0bcf8 100644 --- a/activation.cpp +++ b/activation.cpp @@ -115,31 +115,37 @@ auto Activation::activation(Activations value) -> Activations } else if (rwVolumeCreated == true && roVolumeCreated == true) { - activationProgress->progress(90); - - if (!redundancyPriority) + if (ubootEnvVarsUpdated == false) { - redundancyPriority = - std::make_unique<RedundancyPriority>(bus, path, *this, 0); - } + activationProgress->progress(90); - activationProgress->progress(100); + if (!redundancyPriority) + { + redundancyPriority = std::make_unique<RedundancyPriority>( + bus, path, *this, 0); + } + } + else + { + activationProgress->progress(100); - activationBlocksTransition.reset(nullptr); - activationProgress.reset(nullptr); + activationBlocksTransition.reset(nullptr); + activationProgress.reset(nullptr); - rwVolumeCreated = false; - roVolumeCreated = false; - Activation::unsubscribeFromSystemdSignals(); + rwVolumeCreated = false; + roVolumeCreated = false; + ubootEnvVarsUpdated = false; + Activation::unsubscribeFromSystemdSignals(); - // Remove version object from image manager - Activation::deleteImageManagerObject(); + // Remove version object from image manager + Activation::deleteImageManagerObject(); - // Create active association - parent.createActiveAssociation(path); + // Create active association + parent.createActiveAssociation(path); - return softwareServer::Activation::activation( - softwareServer::Activation::Activations::Active); + return softwareServer::Activation::activation( + softwareServer::Activation::Activations::Active); + } } } else @@ -171,6 +177,7 @@ auto Activation::requestedActivation(RequestedActivations value) { rwVolumeCreated = false; roVolumeCreated = false; + ubootEnvVarsUpdated = false; if ((value == softwareServer::Activation::RequestedActivations::Active) && (softwareServer::Activation::requestedActivation() != @@ -222,6 +229,8 @@ void Activation::unitStateChange(sdbusplus::message::message& msg) auto rwServiceFile = "obmc-flash-bmc-ubirw.service"; auto roServiceFile = "obmc-flash-bmc-ubiro@" + versionId + ".service"; + auto ubootVarsServiceFile = + "obmc-flash-bmc-updateubootvars@" + versionId + ".service"; if (newStateUnit == rwServiceFile && newStateResult == "done") { @@ -235,14 +244,21 @@ void Activation::unitStateChange(sdbusplus::message::message& msg) activationProgress->progress(activationProgress->progress() + 50); } - if (newStateUnit == rwServiceFile || newStateUnit == roServiceFile) + if (newStateUnit == ubootVarsServiceFile && newStateResult == "done") + { + ubootEnvVarsUpdated = true; + } + + if (newStateUnit == rwServiceFile || newStateUnit == roServiceFile || + newStateUnit == ubootVarsServiceFile) { if (newStateResult == "failed" || newStateResult == "dependency") { Activation::activation( softwareServer::Activation::Activations::Failed); } - else if (rwVolumeCreated && roVolumeCreated) // Volumes were created + else if ((rwVolumeCreated && roVolumeCreated) || // Volumes were created + (ubootEnvVarsUpdated)) // Environment variables were updated { Activation::activation( softwareServer::Activation::Activations::Activating); diff --git a/activation.hpp b/activation.hpp index 50f5338..51756f2 100644 --- a/activation.hpp +++ b/activation.hpp @@ -311,6 +311,10 @@ class Activation : public ActivationInherit /** @brief Tracks whether the read-only volume has been created as * part of the activation process. **/ bool roVolumeCreated = false; + + /** @brief Tracks if the service that updates the U-Boot environment + * variables has completed. **/ + bool ubootEnvVarsUpdated = false; }; } // namespace updater |

