diff options
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch')
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch index 54efbee8c..c10dadea4 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0015-Fix-delete-image-by-ID-and-inhibit-removal-of-bmc_ac.patch @@ -1,13 +1,13 @@ -From f2dd5e13a0774d8683542798dd96979f9d7a6691 Mon Sep 17 00:00:00 2001 +From f268c4679e391e213c36d2046f0d95b858f41054 Mon Sep 17 00:00:00 2001 From: Vernon Mauery <vernon.mauery@intel.com> Date: Tue, 29 Sep 2020 13:38:35 -0700 Subject: [PATCH] Fix delete image by ID and inhibit removal of bmc_active Delete image by ID was broken because when hitting the delete dbus interface, it recalculated the ID from the parent version, which then -does not match because of the random number addition that was added to -the ID when the parent interface was created. This saves away the parent -interface ID and recalls it rather than recalculating it. +does not match because of the random number addition that was added +to the ID when the parent interface was created. This saves away the +parent interface ID and recalls it rather than recalculating it. Also, there was a logic error in deleting images that would delete the active BMC image. This fixes up that error. @@ -17,6 +17,7 @@ Tested: run multiple back-to back updates and see that when the fwupd deleted and that the bmc_active interface is not deleted. Signed-off-by: Vernon Mauery <vernon.mauery@intel.com> +Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> --- item_updater.cpp | 17 +++++++++++------ pfr_image_manager.cpp | 2 +- @@ -25,10 +26,10 @@ Signed-off-by: Vernon Mauery <vernon.mauery@intel.com> 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/item_updater.cpp b/item_updater.cpp -index db255d6..90970d3 100644 +index 8d7bb82..5bf8b87 100644 --- a/item_updater.cpp +++ b/item_updater.cpp -@@ -133,7 +133,7 @@ void ItemUpdater::createActivation(sdbusplus::message::message& msg) +@@ -132,7 +132,7 @@ void ItemUpdater::createActivation(sdbusplus::message::message& msg) activationState, associations))); auto versionPtr = std::make_unique<VersionClass>( @@ -37,7 +38,7 @@ index db255d6..90970d3 100644 std::bind(&ItemUpdater::erase, this, std::placeholders::_1)); versionPtr->deleteObject = std::make_unique<phosphor::software::manager::Delete>(bus, path, -@@ -247,7 +247,7 @@ void ItemUpdater::processBMCImage() +@@ -224,7 +224,7 @@ void ItemUpdater::processBMCImage() // Create Version instance for this version. auto versionPtr = std::make_unique<VersionClass>( @@ -46,7 +47,7 @@ index db255d6..90970d3 100644 std::bind(&ItemUpdater::erase, this, std::placeholders::_1)); auto isVersionFunctional = versionPtr->isFunctional(); if (!isVersionFunctional) -@@ -322,11 +322,11 @@ void ItemUpdater::erase(std::string entryId) +@@ -298,11 +298,11 @@ void ItemUpdater::erase(std::string entryId) auto it = versions.find(entryId); if (it != versions.end()) { @@ -61,8 +62,8 @@ index db255d6..90970d3 100644 + entry("VERSIONID=%s", entryId.c_str())); return; } - } -@@ -669,6 +669,11 @@ void ItemUpdater::freeSpace(Activation& caller) + +@@ -633,6 +633,11 @@ void ItemUpdater::freeSpace(Activation& caller) std::size_t count = 0; for (const auto& iter : activations) { @@ -75,10 +76,10 @@ index db255d6..90970d3 100644 server::Activation::Activations::Active) || (iter.second.get()->activation() == diff --git a/pfr_image_manager.cpp b/pfr_image_manager.cpp -index 145237e..0c6c3d8 100644 +index ba73cc1..36f0a62 100644 --- a/pfr_image_manager.cpp +++ b/pfr_image_manager.cpp -@@ -308,7 +308,7 @@ int Manager::processImage(const std::string& imgFilePath) +@@ -265,7 +265,7 @@ int Manager::processImage(const std::string& imgFilePath) std::string objPath = std::string{SOFTWARE_OBJPATH} + '/' + id; auto versionPtr = std::make_unique<Version>( @@ -88,10 +89,10 @@ index 145237e..0c6c3d8 100644 versionPtr->deleteObject = std::make_unique<phosphor::software::manager::Delete>(bus, objPath, diff --git a/version.cpp b/version.cpp -index 18f3f4f..e6fd481 100644 +index f50500a..1471233 100644 --- a/version.cpp +++ b/version.cpp -@@ -182,7 +182,7 @@ void Delete::delete_() +@@ -181,7 +181,7 @@ void Delete::delete_() { if (parent.eraseCallback) { @@ -101,10 +102,10 @@ index 18f3f4f..e6fd481 100644 } diff --git a/version.hpp b/version.hpp -index 9cf76da..ae70ea8 100644 +index 5827c8a..ad1170a 100644 --- a/version.hpp +++ b/version.hpp -@@ -74,14 +74,15 @@ class Version : public VersionInherit +@@ -73,14 +73,15 @@ class Version : public VersionInherit * @param[in] callback - The eraseFunc callback */ Version(sdbusplus::bus::bus& bus, const std::string& objPath, @@ -115,16 +116,16 @@ index 9cf76da..ae70ea8 100644 + eraseFunc callback) : VersionInherit(bus, (objPath).c_str(), true), - eraseCallback(callback), versionStr(versionString) -+ eraseCallback(callback), extId(extId), versionStr(versionString) ++ eraseCallback(callback), versionStr(versionString), extId(extId) { // Set properties. purpose(versionPurpose); - version(versionString); -+ version(extId); ++ version(versionStr); path(filePath); // Emit deferred signal. emit_object_added(); -@@ -134,6 +135,15 @@ class Version : public VersionInherit +@@ -133,6 +134,15 @@ class Version : public VersionInherit */ bool isFunctional(); @@ -140,7 +141,7 @@ index 9cf76da..ae70ea8 100644 /** @brief Persistent Delete D-Bus object */ std::unique_ptr<Delete> deleteObject; -@@ -143,6 +153,7 @@ class Version : public VersionInherit +@@ -142,6 +152,7 @@ class Version : public VersionInherit private: /** @brief This Version's version string */ const std::string versionStr; @@ -149,5 +150,5 @@ index 9cf76da..ae70ea8 100644 } // namespace manager -- -2.17.1 +2.7.4 |