Create ActivationBlocksTransition before write HOST BIOS image

Currently, Host can be turned on and the BMC can reboot during HOST BIOS
image is flashing. it can make the flashing fails.
Enable ActivationBlocksTransition before write HOST BIOS image to block
turning on HOST or reboot BMC when flashing did not complete.

Tested:
      1. Request to write new Host bios image via Redfish.
      2. Turn on HOST.
      3. HOST still is off until flashing completed.
      4. New HOST BIOS image is flashed.

Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
Change-Id: Ifa8ec1a96bc9c1ecf0dbdcc5d11435c0f594d66b
diff --git a/activation.cpp b/activation.cpp
index 721e2cb..8e71d8c 100644
--- a/activation.cpp
+++ b/activation.cpp
@@ -104,29 +104,6 @@
         }
 #endif
 
-#ifdef HOST_BIOS_UPGRADE
-        auto purpose = parent.versions.find(versionId)->second->purpose();
-        if (purpose == VersionPurpose::Host)
-        {
-            if (!activationProgress)
-            {
-                activationProgress =
-                    std::make_unique<ActivationProgress>(bus, path);
-            }
-
-            // Enable systemd signals
-            subscribeToSystemdSignals();
-
-            // Set initial progress
-            activationProgress->progress(20);
-
-            // Initiate image writing to flash
-            flashWriteHost();
-
-            return softwareServer::Activation::activation(value);
-        }
-#endif
-
         auto versionStr = parent.versions.find(versionId)->second->version();
 
         if (!minimum_ship_level::verify(versionStr))
@@ -157,6 +134,23 @@
                 std::make_unique<ActivationBlocksTransition>(bus, path);
         }
 
+#ifdef HOST_BIOS_UPGRADE
+        auto purpose = parent.versions.find(versionId)->second->purpose();
+        if (purpose == VersionPurpose::Host)
+        {
+            // Enable systemd signals
+            subscribeToSystemdSignals();
+
+            // Set initial progress
+            activationProgress->progress(20);
+
+            // Initiate image writing to flash
+            flashWriteHost();
+
+            return softwareServer::Activation::activation(value);
+        }
+#endif
+
         activationProgress->progress(10);
 
         parent.freeSpace(*this);