Implement host factory reset in item_updater
This commit implements a factory reset interface for the host.
This factory reset is accomplished by clearing all read/write
PNOR partitions.
Resolves openbmc/openbmc#1574
Change-Id: Ia2c9bd9cf829520bc724abb48aa2df3163f7d78a
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
diff --git a/item_updater.hpp b/item_updater.hpp
index 8e79d1d..0e8558a 100755
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -2,6 +2,7 @@
#include <sdbusplus/server.hpp>
#include "activation.hpp"
+#include <xyz/openbmc_project/Common/FactoryReset/server.hpp>
namespace openpower
{
@@ -10,24 +11,22 @@
namespace updater
{
+using ItemUpdaterInherit = sdbusplus::server::object::object<
+ sdbusplus::xyz::openbmc_project::Common::server::FactoryReset>;
+
/** @class ItemUpdater
* @brief Manages the activation of the version items.
*/
-class ItemUpdater
+class ItemUpdater : public ItemUpdaterInherit
{
public:
- ItemUpdater() = delete;
- ~ItemUpdater() = default;
- ItemUpdater(const ItemUpdater&) = delete;
- ItemUpdater& operator=(const ItemUpdater&) = delete;
- ItemUpdater(ItemUpdater&&) = delete;
- ItemUpdater& operator=(ItemUpdater&&) = delete;
-
/** @brief Constructs ItemUpdater
*
* @param[in] bus - The Dbus bus object
+ * @param[in] path - The Dbus path
*/
- ItemUpdater(sdbusplus::bus::bus& bus) :
+ ItemUpdater(sdbusplus::bus::bus& bus, const std::string& path) :
+ ItemUpdaterInherit(bus, path.c_str()),
busItem(bus),
versionMatch(
bus,
@@ -79,9 +78,12 @@
/** @brief sdbusplus signal match for Software.Version */
sdbusplus::server::match::match versionMatch;
+
+ /** @brief Host factory reset - clears PNOR partitions for each
+ * Activation dbus object */
+ void reset() override;
};
} // namespace updater
} // namespace software
} // namespace openpower
-