summaryrefslogtreecommitdiffstats
path: root/ubi
diff options
context:
space:
mode:
authorJayashankar Padath <jayashankar.padath@in.ibm.com>2019-07-24 16:46:22 +0530
committerAdriana Kobylak <anoo@linux.ibm.com>2019-08-09 20:45:06 +0000
commit4d3d91262bcaf1afc2eee54145052106644410be (patch)
treea38b42c90db405f19b742fd08dc513451d187346 /ubi
parentabe862aae4527b4df569f9c664898202a073dabc (diff)
downloadopenpower-pnor-code-mgmt-4d3d91262bcaf1afc2eee54145052106644410be.tar.gz
openpower-pnor-code-mgmt-4d3d91262bcaf1afc2eee54145052106644410be.zip
Code Update: Host ApplyTime support
Get the requested image apply time value provided through the UpdateService redfish schema. If the apply time value is Immediate, then host reboot will be triggered just after the new pnor image activation. The default apply time value is OnReset in which the new image remains at Active state and user has to manualy reboot the host for applying the new image. Tested: Verified that host is getting rebooted while doing a pnor code update if the apply time value is Immediate. Tested this use case at server power Off and Running scenarios. OnReset scenario was also tested in which new image remained at Active state as pnor code update application did not trigger the host reboot. Note: This change is applicable to ubi based systems (Witherspoon) Signed-off-by: Jayashankar Padath <jayashankar.padath@in.ibm.com> Change-Id: I74f73172626919b225efef43d9baacd64eadbf60
Diffstat (limited to 'ubi')
-rw-r--r--ubi/activation_ubi.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/ubi/activation_ubi.cpp b/ubi/activation_ubi.cpp
index 5c57c4b56..4575a610c 100644
--- a/ubi/activation_ubi.cpp
+++ b/ubi/activation_ubi.cpp
@@ -4,6 +4,7 @@
#include "serialize.hpp"
#include <experimental/filesystem>
+#include <phosphor-logging/log.hpp>
namespace openpower
{
@@ -13,6 +14,7 @@ namespace updater
{
namespace fs = std::experimental::filesystem;
namespace softwareServer = sdbusplus::xyz::openbmc_project::Software::server;
+using namespace phosphor::logging;
uint8_t RedundancyPriorityUbi::priority(uint8_t value)
{
@@ -65,6 +67,12 @@ auto ActivationUbi::activation(Activations value) -> Activations
(fs::is_directory(PNOR_RO_PREFIX + versionId)))
{
finishActivation();
+ if (Activation::checkApplyTimeImmediate())
+ {
+ log<level::INFO>("Image Active. ApplyTime is immediate, "
+ "rebooting Host.");
+ Activation::rebootHost();
+ }
return softwareServer::Activation::activation(
softwareServer::Activation::Activations::Active);
}
OpenPOWER on IntegriCloud