diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2017-11-07 13:22:59 -0600 |
---|---|---|
committer | Adriana Kobylak <anoo@us.ibm.com> | 2018-01-10 12:02:17 -0600 |
commit | 7cb480ed7b0fc76eca66b1eaadb99d54da28e1ae (patch) | |
tree | af3e0172d551af59d9c79d39b087f3ce3e8a744e | |
parent | bb31f028fe1a1f9c00ac2befeff68a1c081c6fb3 (diff) | |
download | openpower-pnor-code-mgmt-7cb480ed7b0fc76eca66b1eaadb99d54da28e1ae.tar.gz openpower-pnor-code-mgmt-7cb480ed7b0fc76eca66b1eaadb99d54da28e1ae.zip |
item_updater: Add Volatile Object Enable dbus object
Add an Enable dbus object to determine if the Volatile PNOR partitions
should be cleared. An Enabled value of false (default) means volatile
is disabled and the partitions should not be cleared.
This property would be set by the host via IPMI, and the BMC would
check it on the power on path.
Part of openbmc/openbmc#2397
Change-Id: Ic9362206d2b1d4fd44b3505ed53e72ec240ad60c
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rwxr-xr-x | item_updater.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/item_updater.hpp b/item_updater.hpp index 0b430fe0f..f09891c72 100755 --- a/item_updater.hpp +++ b/item_updater.hpp @@ -3,6 +3,7 @@ #include <sdbusplus/server.hpp> #include "activation.hpp" #include <xyz/openbmc_project/Common/FactoryReset/server.hpp> +#include <xyz/openbmc_project/Object/Enable/server.hpp> #include "version.hpp" #include "org/openbmc/Associations/server.hpp" #include "xyz/openbmc_project/Collection/DeleteAll/server.hpp" @@ -20,12 +21,15 @@ using ItemUpdaterInherit = sdbusplus::server::object::object< sdbusplus::xyz::openbmc_project::Collection::server::DeleteAll>; using GardResetInherit = sdbusplus::server::object::object< sdbusplus::xyz::openbmc_project::Common::server::FactoryReset>; +using ObjectEnable = sdbusplus::server::object::object< + sdbusplus::xyz::openbmc_project::Object::server::Enable>; namespace MatchRules = sdbusplus::bus::match::rules; using AssociationList = std::vector<std::tuple<std::string, std::string, std::string>>; constexpr auto GARD_PATH = "/org/open_power/control/gard"; +constexpr static auto volatilePath = "/org/open_power/control/volatile"; /** @class GardReset * @brief OpenBMC GARD factory reset implementation. @@ -94,6 +98,7 @@ class ItemUpdater : public ItemUpdaterInherit { processPNORImage(); gardReset = std::make_unique<GardReset>(bus, GARD_PATH); + volatileEnable = std::make_unique<ObjectEnable>(bus, volatilePath); // Emit deferred signal. emit_object_added(); @@ -180,6 +185,9 @@ class ItemUpdater : public ItemUpdaterInherit */ static bool isVersionFunctional(const std::string& versionId); + /** @brief Persistent ObjectEnable D-Bus object */ + std::unique_ptr<ObjectEnable> volatileEnable; + private: /** @brief Callback function for Software.Version match. * @details Creates an Activation D-Bus object. |