fw update: common code
new daemons to implement the flow as described in
https://github.com/openbmc/docs/blob/master/designs/code-update.md
- common/
common code folder
- common update flow
- base class for the device specific update daemons
The new daemons are all following the generic template of Code Updater
daemon as outlined in the design.
The idea is that they are separate daemons (per device, as outlined in
the design) but share all the code that's not device specific.
Tested: next patch in series
Change-Id: If2438b8506aceb8c5313ec13a0bf7cb68f3cc279
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/common/include/software_update.hpp b/common/include/software_update.hpp
new file mode 100644
index 0000000..406c282
--- /dev/null
+++ b/common/include/software_update.hpp
@@ -0,0 +1,37 @@
+#pragma once
+
+#include <sdbusplus/async/context.hpp>
+#include <xyz/openbmc_project/Software/Update/aserver.hpp>
+
+namespace phosphor::software
+{
+class Software;
+};
+
+using RequestedApplyTimes = sdbusplus::common::xyz::openbmc_project::software::
+ ApplyTime::RequestedApplyTimes;
+
+namespace phosphor::software::update
+{
+
+class SoftwareUpdate :
+ public sdbusplus::aserver::xyz::openbmc_project::software::Update<
+ SoftwareUpdate>
+{
+ public:
+ SoftwareUpdate(sdbusplus::async::context& ctx, const char* path,
+ Software& software,
+ const std::set<RequestedApplyTimes>& allowedApplyTimes);
+
+ auto method_call(start_update_t su, auto image, auto applyTime)
+ -> sdbusplus::async::task<start_update_t::return_type>;
+
+ auto get_property(allowed_apply_times_t aat) const;
+
+ private:
+ Software& software;
+
+ const std::set<RequestedApplyTimes> allowedApplyTimes;
+};
+
+}; // namespace phosphor::software::update