diff options
Diffstat (limited to 'item_updater.cpp')
-rw-r--r-- | item_updater.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/item_updater.cpp b/item_updater.cpp index 101489050..e9a283d70 100644 --- a/item_updater.cpp +++ b/item_updater.cpp @@ -158,6 +158,7 @@ void ItemUpdater::processPNORImage() auto activationState = server::Activation::Activations::Active; static const auto PNOR_RO_PREFIX_LEN = strlen(PNOR_RO_PREFIX); + static const auto PNOR_RW_PREFIX_LEN = strlen(PNOR_RW_PREFIX); // Check if the PNOR_RO_PREFIX is the prefix of the iter.path if (0 == iter.path().native().compare(0, PNOR_RO_PREFIX_LEN, @@ -249,6 +250,18 @@ void ItemUpdater::processPNORImage() "", *this))); } + else if (0 == iter.path().native().compare(0, PNOR_RW_PREFIX_LEN, + PNOR_RW_PREFIX)) + { + auto id = iter.path().native().substr(PNOR_RW_PREFIX_LEN); + auto roDir = PNOR_RO_PREFIX + id; + if (!fs::is_directory(roDir)) + { + log<level::ERR>("No corresponding read-only volume found.", + entry("DIRNAME=%s", roDir)); + ItemUpdater::erase(id); + } + } } // Look at the RO symlink to determine if there is a functional image |