serialize: Add version purpose
Add store/restore of the version purpose. Only need to store it if the
activation was successful, since those are the only versions that are
restored after BMC reboot.
Tested: Verified a code update with an image of purpose System got its
value restored instead of being set to BMC by default.
Change-Id: I6414e9f3b992a8c29046b4d3a3d581c20a166cee
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/item_updater.cpp b/item_updater.cpp
index 7fc9fa3..2cd9c39 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -190,6 +190,8 @@
}
auto purpose = server::Version::VersionPurpose::BMC;
+ restorePurpose(id, purpose);
+
auto path = fs::path(SOFTWARE_OBJPATH) / id;
// Create functional association if this is the functional