BMC: Update u-boot environment variable based on lowest priority
- If a BMC is set to the lowest priority then update the u-boot
environment variables so that that system boots from that version
on the next reboot.
Resolves openbmc/openbmc#2284
Change-Id: If0b67b07496f602fa06607bd0685d6394cb8d9fd
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/item_updater.hpp b/item_updater.hpp
index 4b7ddd5..d55e807 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -66,10 +66,11 @@
* any existing priority with the same value by 1
*
* @param[in] value - The priority that needs to be set free.
- *
+ * @param[in] versionId - The Id of the version for which we
+ * are trying to free up the priority.
* @return None
*/
- void freePriority(uint8_t value);
+ void freePriority(uint8_t value, const std::string& versionId);
/**
* @brief Create and populate the active BMC Version.
@@ -98,6 +99,15 @@
*/
void removeActiveAssociation(const std::string& path);
+ /** @brief Determine if the given priority is the lowest
+ *
+ * @param[in] value - The priority that needs to be checked.
+ *
+ * @return boolean corresponding to whether the given
+ * priority is lowest.
+ */
+ bool isLowestPriority(uint8_t value);
+
private:
/** @brief Callback function for Software.Version match.
* @details Creates an Activation dbus object.