Combine the creation of ro and rw partition in one service file

- Use the combine ubimount service file that creates both
  rw and ro partition.

Change-Id: I40438bc16ac4f5734a749b7bf218ea5c6f628339
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/activation.cpp b/activation.cpp
index 5b54571..f7cfd1a 100755
--- a/activation.cpp
+++ b/activation.cpp
@@ -57,22 +57,10 @@
                 std::make_unique<ActivationBlocksTransition>(bus, path);
     }
 
-    constexpr auto squashfsMountService =
-            "obmc-flash-bios-squashfsmount@";
-    auto squashfsMountServiceFile = std::string(squashfsMountService) +
-            versionId + ".service";
-    auto method = bus.new_method_call(
-            SYSTEMD_BUSNAME,
-            SYSTEMD_PATH,
-            SYSTEMD_INTERFACE,
-            "StartUnit");
-    method.append(squashfsMountServiceFile, "replace");
-    bus.call_noreply(method);
-
     constexpr auto ubimountService = "obmc-flash-bios-ubimount@";
     auto ubimountServiceFile = std::string(ubimountService) +
            versionId + ".service";
-    method = bus.new_method_call(
+    auto method = bus.new_method_call(
             SYSTEMD_BUSNAME,
             SYSTEMD_PATH,
             SYSTEMD_INTERFACE,
@@ -99,8 +87,7 @@
     activationBlocksTransition.reset(nullptr);
     activationProgress.reset(nullptr);
 
-    squashfsLoaded = false;
-    rwVolumesCreated = false;
+    ubiVolumesCreated = false;
     Activation::unsubscribeFromSystemdSignals();
     // Create active association
     parent.createActiveAssociation(path);
@@ -120,12 +107,12 @@
         parent.freeSpace();
         softwareServer::Activation::activation(value);
 
-        if (squashfsLoaded == false && rwVolumesCreated == false)
+        if (ubiVolumesCreated == false)
         {
             Activation::startActivation();
             return softwareServer::Activation::activation(value);
         }
-        else if (squashfsLoaded == true && rwVolumesCreated == true)
+        else if (ubiVolumesCreated == true)
         {
             // Only when the squashfs image is finished loading AND the RW
             // volumes have been created do we proceed with activation. To
@@ -161,8 +148,7 @@
 auto Activation::requestedActivation(RequestedActivations value) ->
         RequestedActivations
 {
-    squashfsLoaded = false;
-    rwVolumesCreated = false;
+    ubiVolumesCreated = false;
 
     if ((value == softwareServer::Activation::RequestedActivations::Active) &&
         (softwareServer::Activation::requestedActivation() !=
@@ -198,32 +184,22 @@
     //Read the msg and populate each variable
     msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult);
 
-    auto squashfsMountServiceFile =
-            "obmc-flash-bios-squashfsmount@" + versionId + ".service";
-
     auto ubimountServiceFile =
             "obmc-flash-bios-ubimount@" + versionId + ".service";
 
-    if(newStateUnit == squashfsMountServiceFile && newStateResult == "done")
-    {
-        squashfsLoaded = true;
-        activationProgress->progress(activationProgress->progress() + 20);
-    }
-
     if(newStateUnit == ubimountServiceFile && newStateResult == "done")
     {
-        rwVolumesCreated = true;
+        ubiVolumesCreated = true;
         activationProgress->progress(activationProgress->progress() + 50);
     }
 
-    if(squashfsLoaded && rwVolumesCreated)
+    if(ubiVolumesCreated)
     {
         Activation::activation(
                 softwareServer::Activation::Activations::Activating);
     }
 
-    if((newStateUnit == squashfsMountServiceFile ||
-        newStateUnit == ubimountServiceFile) &&
+    if((newStateUnit == ubimountServiceFile) &&
         (newStateResult == "failed" || newStateResult == "dependency"))
     {
         Activation::activation(softwareServer::Activation::Activations::Failed);
diff --git a/activation.hpp b/activation.hpp
index fa27086..3fcb622 100755
--- a/activation.hpp
+++ b/activation.hpp
@@ -294,13 +294,9 @@
         /** @brief Used to subscribe to dbus systemd signals **/
         sdbusplus::bus::match_t systemdSignals;
 
-        /** @brief Tracks whether the squashfs image has been loaded as part of
-         * the activation process. **/
-        bool squashfsLoaded = false;
-
-        /** @brief Tracks whether the read-write volumes have been created as
-         * part of the activation process. **/
-        bool rwVolumesCreated = false;
+        /** @brief Tracks whether the read-only & read-write volumes have been
+         *created as part of the activation process. **/
+        bool ubiVolumesCreated = false;
 
         /** @brief activation status property get function
          *
diff --git a/item_updater.cpp b/item_updater.cpp
index 6df57ac..101bc00 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -344,7 +344,7 @@
     // Remove priority persistence file
     removeFile(entryId);
 
-    // Removing partitions
+    // Removing read-only and read-write partitions
     removeReadWritePartition(entryId);
     removeReadOnlyPartition(entryId);
 
diff --git a/item_updater.hpp b/item_updater.hpp
index affbe53..812c9fe 100755
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -141,7 +141,7 @@
         /** @brief Clears read write PNOR partition for
          *  given Activation dbus object
          *
-         * @param[in]  versionId - The id of the rw partition to remove.
+         *  @param[in]  versionId - The id of the rw partition to remove.
          */
         void removeReadWritePartition(std::string versionId);