Refactor: Split item_updater to common and ubi

The existing item_updater is highly coupled with ubifs.
It will support static layout and ubi in future.
So split the functions in to common ones and ubi specific ones, and move
the ubi specific code in ubi dir.

1. Keep common functions and make them virtual for extension.
    createActiveAssociation()
    updateFunctionalAssociation()
    removeAssociation()
    erase()
2. Create ubi/item_updater_ubi and move other functions into it.
3. Change updateFunctionalAssociation() parameter for future use.

To support static layout, a new item_updater_static will be written.

Tested: On the last commit of the patch series, run code update and
        factory reset on Witherspoon and all work fine.

Change-Id: I4cc55b31ee3f37c5b27168611305dee8ce02880a
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/watch.cpp b/watch.cpp
index 35cbb15..192d3d9 100644
--- a/watch.cpp
+++ b/watch.cpp
@@ -26,7 +26,7 @@
 namespace fs = std::experimental::filesystem;
 
 Watch::Watch(sd_event* loop,
-             std::function<void(std::string&)> functionalCallback) :
+             std::function<void(const std::string&)> functionalCallback) :
     functionalCallback(functionalCallback),
     fd(inotifyInit())
 
@@ -94,9 +94,7 @@
         if (fs::equivalent(path, PNOR_RO_ACTIVE_PATH))
         {
             auto id = ItemUpdater::determineId(path);
-            auto objPath = std::string{SOFTWARE_OBJPATH} + '/' + id;
-
-            static_cast<Watch*>(userdata)->functionalCallback(objPath);
+            static_cast<Watch*>(userdata)->functionalCallback(id);
         }
         offset += offsetof(inotify_event, name) + event->len;
     }