start-update-interface: implement update manager
Implement the update manager module for the new daemon inheriting from
the Update D-Bus interface. Link with new interface APIs from
item_updater and software utils. New daemon will continue to exist at
runtime alongwith old flow, until old flow is deprecated and removed.
This change is based on -
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/65738
https://gerrit.openbmc.org/c/openbmc/docs/+/65739
Change-Id: I0ecbbb8fc5340de7f66f8870ae389b405a2debee
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/item_updater.hpp b/item_updater.hpp
index 1f3c0f1..e1a8d3f 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -3,6 +3,7 @@
#include "activation.hpp"
#include "item_updater_helper.hpp"
#include "msl_verify.hpp"
+#include "update_manager.hpp"
#include "version.hpp"
#include "xyz/openbmc_project/Collection/DeleteAll/server.hpp"
@@ -37,6 +38,7 @@
using VersionClass = phosphor::software::manager::Version;
using AssociationList =
std::vector<std::tuple<std::string, std::string, std::string>>;
+using UpdateManager = phosphor::software::update::Manager;
/** @class MinimumVersion
* @brief OpenBMC MinimumVersion implementation.
@@ -80,8 +82,8 @@
bool useUpdateDBusInterface = true) :
ItemUpdaterInherit(ctx.get_bus(), path.c_str(),
ItemUpdaterInherit::action::defer_emit),
- useUpdateDBusInterface(useUpdateDBusInterface), bus(ctx.get_bus()),
- helper(bus)
+ useUpdateDBusInterface(useUpdateDBusInterface), ctx(ctx),
+ bus(ctx.get_bus()), helper(bus)
{
if (!useUpdateDBusInterface)
{
@@ -171,6 +173,13 @@
ActivationIntf::Activations status);
/**
+ * @brief Create the Update object
+ * @param[in] id - The unique identifier for the update.
+ * @param[in] path - The object path for the update object.
+ */
+ void createUpdateObject(const std::string& id, const std::string& path);
+
+ /**
* @brief Erase specified entry D-Bus object
* if Action property is not set to Active
*
@@ -302,6 +311,9 @@
*/
void createFunctionalAssociation(const std::string& path);
+ /** @brief D-Bus context */
+ sdbusplus::async::context& ctx;
+
/** @brief Persistent sdbusplus D-Bus bus connection. */
sdbusplus::bus_t& bus;
@@ -344,6 +356,9 @@
/** @brief Persistent MinimumVersion D-Bus object */
std::unique_ptr<MinimumVersion> minimumVersionObject;
+ /** @brief Persistent map of Update D-Bus objects and their SwIds */
+ std::map<std::string, std::unique_ptr<UpdateManager>> updateManagers;
+
#ifdef HOST_BIOS_UPGRADE
/** @brief Create the BIOS object without knowing the version.
*