summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tritz <mtritz@us.ibm.com>2017-11-22 11:51:29 -0600
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-01-04 04:36:05 +0000
commitbb31f028fe1a1f9c00ac2befeff68a1c081c6fb3 (patch)
tree25b576d74e5653ea5fa987beaf7acfc8c739f71f
parent4ecea0f3316090fe8782917d7f7f614e5740fe46 (diff)
downloadopenpower-pnor-code-mgmt-bb31f028fe1a1f9c00ac2befeff68a1c081c6fb3.tar.gz
openpower-pnor-code-mgmt-bb31f028fe1a1f9c00ac2befeff68a1c081c6fb3.zip
Clear files in pnor-patch directory on host factory reset
This patch extends the functionality of the host factory reset by clearing the pnor-patch directory at /usr/local/share/pnor. Change-Id: I9d4e3838eee3e743bd954fad697ae84deda0518c Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
-rw-r--r--item_updater.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/item_updater.cpp b/item_updater.cpp
index 03ff20b92..becff4671 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -327,6 +327,15 @@ void ItemUpdater::removeReadWritePartition(std::string versionId)
void ItemUpdater::reset()
{
+ constexpr static auto patchDir = "/usr/local/share/pnor";
+ if (fs::is_directory(patchDir))
+ {
+ for (const auto& iter : fs::directory_iterator(patchDir))
+ {
+ fs::remove_all(iter);
+ }
+ }
+
for (const auto& it : activations)
{
auto serviceFile = "obmc-flash-bios-ubiclear@pnor-rw-" + it.first +
OpenPOWER on IntegriCloud