diff options
| author | Adriana Kobylak <anoo@us.ibm.com> | 2018-05-30 13:16:20 -0500 |
|---|---|---|
| committer | Adriana Kobylak <anoo@us.ibm.com> | 2018-06-06 16:40:03 -0500 |
| commit | 9f89e2e1cf7e739dcd3cb975815ed37750c81c26 (patch) | |
| tree | af07ba021046e99e077c837fb2fa45cb599ff338 /ubi | |
| parent | 4b35dd31529e489b5f2f74c1d34900713c8032fc (diff) | |
| download | phosphor-bmc-code-mgmt-9f89e2e1cf7e739dcd3cb975815ed37750c81c26.tar.gz phosphor-bmc-code-mgmt-9f89e2e1cf7e739dcd3cb975815ed37750c81c26.zip | |
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>
Diffstat (limited to 'ubi')
| -rw-r--r-- | ubi/Makefile.am.include | 2 | ||||
| -rw-r--r-- | ubi/flash.cpp | 29 |
2 files changed, 31 insertions, 0 deletions
diff --git a/ubi/Makefile.am.include b/ubi/Makefile.am.include new file mode 100644 index 0000000..7bcfcb2 --- /dev/null +++ b/ubi/Makefile.am.include @@ -0,0 +1,2 @@ +phosphor_image_updater_SOURCES += \ + %reldir%/flash.cpp diff --git a/ubi/flash.cpp b/ubi/flash.cpp new file mode 100644 index 0000000..39015bd --- /dev/null +++ b/ubi/flash.cpp @@ -0,0 +1,29 @@ +#include "activation.hpp" +#include "config.h" + +namespace phosphor +{ +namespace software +{ +namespace updater +{ + +void Activation::flashWrite() +{ + auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, + SYSTEMD_INTERFACE, "StartUnit"); + method.append("obmc-flash-bmc-ubirw.service", "replace"); + bus.call_noreply(method); + + auto roServiceFile = "obmc-flash-bmc-ubiro@" + versionId + ".service"; + method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH, + SYSTEMD_INTERFACE, "StartUnit"); + method.append(roServiceFile, "replace"); + bus.call_noreply(method); + + return; +} + +} // namespace updater +} // namespace software +} // namepsace phosphor |

