activation: Create ubi write function
Move the code that creates the ubi volumes into a separate
write flash function to make it easier to implement
different flash write functions for other flash layouts.
To implement a different write flash function:
1. Modify the Makefile.am file to include the desired code
location. Ex:
if UBI
include ubi/Makefile.am.include
else
include <other>/Makefile.am.include
2. Implement the Activation::flashWrite in <other>/flash.cpp
Tested: Verified code update still worked.
Change-Id: Ide4d135695dad27e0dc1b5a776a276dfb2ca9aa6
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/activation.hpp b/activation.hpp
index 51756f2..55377b1 100644
--- a/activation.hpp
+++ b/activation.hpp
@@ -3,6 +3,7 @@
#include <sdbusplus/server.hpp>
#include <xyz/openbmc_project/Software/Activation/server.hpp>
#include <xyz/openbmc_project/Software/ActivationBlocksTransition/server.hpp>
+#include "flash.hpp"
#include "xyz/openbmc_project/Software/RedundancyPriority/server.hpp"
#include "xyz/openbmc_project/Software/ActivationProgress/server.hpp"
#include "org/openbmc/Associations/server.hpp"
@@ -188,7 +189,7 @@
* @details A concrete implementation for
* xyz.openbmc_project.Software.Activation DBus API.
*/
-class Activation : public ActivationInherit
+class Activation : public ActivationInherit, Flash
{
public:
/** @brief Constructs Activation Software Manager
@@ -245,6 +246,9 @@
RequestedActivations
requestedActivation(RequestedActivations value) override;
+ /** @brief Overloaded write flash function */
+ void flashWrite() override;
+
/** @brief Check if systemd state change is relevant to this object
*
* Instance specific interface to handle the detected systemd state