Use flash id to write image to flash

Update the item updater helper functions to take the flash id instead of
the version id since flash id is the name of the volumes/partitions.

The flash id was being persisted for the mmc layout with the name of
"partlabel". This is not needed anymore since the flash id is now being
passed by the service files.

The write functions/service files still use the version id to know where
the image files are located in /tmp/. They then set the value of flash
id (Path property) which is then used by the other functions such as
Delete and setting the u-boot environment variables.

Tested: Code update and Delete functions work on ubi and mmc.

Change-Id: I87c5b8ae2e24af30256dc3b436859835f14cda05
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/ubi/flash.cpp b/ubi/flash.cpp
index c58eefc..0089d01 100644
--- a/ubi/flash.cpp
+++ b/ubi/flash.cpp
@@ -1,6 +1,7 @@
 #include "config.h"
 
 #include "activation.hpp"
+#include "item_updater.hpp"
 
 namespace phosphor
 {
@@ -39,8 +40,9 @@
 
     auto rwServiceFile = "obmc-flash-bmc-ubirw.service";
     auto roServiceFile = "obmc-flash-bmc-ubiro@" + versionId + ".service";
+    auto flashId = parent.versions.find(versionId)->second->path();
     auto ubootVarsServiceFile =
-        "obmc-flash-bmc-updateubootvars@" + versionId + ".service";
+        "obmc-flash-bmc-updateubootvars@" + flashId + ".service";
 
     if (newStateUnit == rwServiceFile && newStateResult == "done")
     {