summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2019-02-22 14:21:22 +0800
committerLei YU <mine260309@gmail.com>2019-03-07 10:46:36 +0800
commitda6ab6cb250354a69e0be1239323ee3c370dfe7d (patch)
tree7358df01e627f4c5597d1b9a2f11955e37ff202d
parentf3ce4337c959001fc764960fe133edbb71c95c5a (diff)
downloadopenpower-pnor-code-mgmt-da6ab6cb250354a69e0be1239323ee3c370dfe7d.tar.gz
openpower-pnor-code-mgmt-da6ab6cb250354a69e0be1239323ee3c370dfe7d.zip
Refactor: Move watch to ubi
watch is ubi specific functions, move it to ubi dir. Tested: On the last commit of the patch series, run code update and factory reset on Witherspoon and all work fine. Change-Id: Ia7f6b6de845ddd40e2a32ad626d3b7af9074c7f3 Signed-off-by: Lei YU <mine260309@gmail.com>
-rwxr-xr-xMakefile.am1
-rw-r--r--item_updater_main.cpp4
-rwxr-xr-xtest/Makefile.am2
-rw-r--r--ubi/Makefile.am.include3
-rw-r--r--ubi/watch.cpp (renamed from watch.cpp)0
-rw-r--r--ubi/watch.hpp (renamed from watch.hpp)0
6 files changed, 6 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index c92494869..716e4537d 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,7 +10,6 @@ openpower_update_manager_SOURCES = \
activation.cpp \
version.cpp \
serialize.cpp \
- watch.cpp \
item_updater.cpp \
item_updater_main.cpp
diff --git a/item_updater_main.cpp b/item_updater_main.cpp
index d0d755471..e54239a89 100644
--- a/item_updater_main.cpp
+++ b/item_updater_main.cpp
@@ -2,8 +2,8 @@
#ifdef UBIFS_LAYOUT
#include "ubi/item_updater_ubi.hpp"
+#include "ubi/watch.hpp"
#endif
-#include "watch.hpp"
#include <phosphor-logging/log.hpp>
#include <sdbusplus/bus.hpp>
@@ -35,10 +35,12 @@ int main(int argc, char* argv[])
bus.request_name(BUSNAME_UPDATER);
try
{
+#ifdef UBIFS_LAYOUT
openpower::software::updater::Watch watch(
loop,
std::bind(std::mem_fn(&ItemUpdater::updateFunctionalAssociation),
&updater, std::placeholders::_1));
+#endif
bus.attach_event(loop, SD_EVENT_PRIORITY_NORMAL);
auto rc = sd_event_loop(loop);
if (rc < 0)
diff --git a/test/Makefile.am b/test/Makefile.am
index 3dc696044..c4165ecbc 100755
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -34,7 +34,7 @@ utest_LDADD = \
$(top_builddir)/openpower_update_manager-activation.o \
$(top_builddir)/openpower_update_manager-version.o \
$(top_builddir)/openpower_update_manager-serialize.o \
- $(top_builddir)/openpower_update_manager-watch.o \
+ $(top_builddir)/ubi/openpower_update_manager-watch.o \
$(top_builddir)/openpower_update_manager-item_updater.o \
$(top_builddir)/org/openbmc/Associations/openpower_update_manager-server.o \
$(top_builddir)/image_verify.cpp \
diff --git a/ubi/Makefile.am.include b/ubi/Makefile.am.include
index fba30d901..a83666101 100644
--- a/ubi/Makefile.am.include
+++ b/ubi/Makefile.am.include
@@ -1,2 +1,3 @@
openpower_update_manager_SOURCES += \
- %reldir%/item_updater_ubi.cpp
+ %reldir%/item_updater_ubi.cpp \
+ %reldir%/watch.cpp
diff --git a/watch.cpp b/ubi/watch.cpp
index 192d3d9b9..192d3d9b9 100644
--- a/watch.cpp
+++ b/ubi/watch.cpp
diff --git a/watch.hpp b/ubi/watch.hpp
index a04967e57..a04967e57 100644
--- a/watch.hpp
+++ b/ubi/watch.hpp
OpenPOWER on IntegriCloud