summaryrefslogtreecommitdiffstats
path: root/ubi
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2019-03-01 16:03:53 +0800
committerLei YU <mine260309@gmail.com>2019-03-13 11:01:53 +0800
commit716de5b8e3867fb829a2c1e39ade2b8f6aa1fa39 (patch)
tree800b067a0ede4da694731fa2ada022d12da9da5f /ubi
parented1c1dc53ef867a24a57a692334c24506dd470c6 (diff)
downloadopenpower-pnor-code-mgmt-716de5b8e3867fb829a2c1e39ade2b8f6aa1fa39.tar.gz
openpower-pnor-code-mgmt-716de5b8e3867fb829a2c1e39ade2b8f6aa1fa39.zip
test: Add sources of static PNOR
Add sources in static dir to test. It generates a link error about duplcated GardReset::reset(). Then an issue is found that GardReset::~GardReset() is not virtual, this will casuse the destructor not calling its super class' dtor. To fix the above link error, add GardReset[Ubi|Static] to make ubi/static specific implementation in its own class. Tested: Verify the test build works fine. Change-Id: I41bd4d522e8b9c4053283c0cf4373807ef4f2d1c Signed-off-by: Lei YU <mine260309@gmail.com>
Diffstat (limited to 'ubi')
-rw-r--r--ubi/item_updater_ubi.cpp2
-rw-r--r--ubi/item_updater_ubi.hpp15
2 files changed, 15 insertions, 2 deletions
diff --git a/ubi/item_updater_ubi.cpp b/ubi/item_updater_ubi.cpp
index 61a8e0156..cf8ffe0f9 100644
--- a/ubi/item_updater_ubi.cpp
+++ b/ubi/item_updater_ubi.cpp
@@ -419,7 +419,7 @@ std::string ItemUpdaterUbi::determineId(const std::string& symlinkPath)
return target.substr(PNOR_RO_PREFIX_LEN);
}
-void GardReset::reset()
+void GardResetUbi::reset()
{
// The GARD partition is currently misspelled "GUARD." This file path will
// need to be updated in the future.
diff --git a/ubi/item_updater_ubi.hpp b/ubi/item_updater_ubi.hpp
index ce1b5b87d..fb6a6ca9c 100644
--- a/ubi/item_updater_ubi.hpp
+++ b/ubi/item_updater_ubi.hpp
@@ -9,6 +9,19 @@ namespace software
namespace updater
{
+class GardResetUbi : public GardReset
+{
+ public:
+ using GardReset::GardReset;
+ virtual ~GardResetUbi() = default;
+
+ protected:
+ /**
+ * @brief GARD factory reset - clears the PNOR GARD partition.
+ */
+ void reset() override;
+};
+
/** @class ItemUpdaterUbi
* @brief Manages the activation of the host version items for ubi layout
*/
@@ -19,7 +32,7 @@ class ItemUpdaterUbi : public ItemUpdater
ItemUpdater(bus, path)
{
processPNORImage();
- gardReset = std::make_unique<GardReset>(bus, GARD_PATH);
+ gardReset = std::make_unique<GardResetUbi>(bus, GARD_PATH);
volatileEnable = std::make_unique<ObjectEnable>(bus, volatilePath);
// Emit deferred signal.
OpenPOWER on IntegriCloud