Mount a SquashFS image to a read-only partition on PNOR

Creating a mount point for SquashFS image so that
the pnor can access the image without explicitly
copying the image on to the PNOR partitions.

The contents of the SquashFS image will be under
/media/pnor-ro-%i.

Resolves openbmc/openbmc#1206

Change-Id: I68b8cf094f9abe192bd697ff32728c959cad26c5
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/activation.cpp b/activation.cpp
index 0a455c3..935382a 100755
--- a/activation.cpp
+++ b/activation.cpp
@@ -22,6 +22,19 @@
                                 bus,
                                 path);
         }
+
+        // Creating a mount point to access squashfs image.
+        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);
     }
     else
     {