Add support for Bios update

Added support for Bios upgrade, this is just first stage where there
is no version check or image verify but later on these features will
also be added.

Currently, this expect a bios image to be copied with manifest file
having version and provide a system unit file to be executed.

To enable this feature need to enable config option
--enable-host_bios_upgrade via bbappend.

Change-Id: If96fe71bad9dc8b187570e9dbbfaac9e9e09e3d1
Signed-off-by: Vijay Khemka <vijaykhemka@fb.com>
diff --git a/item_updater.cpp b/item_updater.cpp
index 2cd9c39..4f2b833 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -64,6 +64,9 @@
                     auto value = SVersion::convertVersionPurposeFromString(
                         variant_ns::get<std::string>(property.second));
                     if (value == VersionPurpose::BMC ||
+#ifdef HOST_BIOS_UPGRADE
+                        value == VersionPurpose::Host ||
+#endif
                         value == VersionPurpose::System)
                     {
                         purpose = value;
@@ -107,8 +110,12 @@
     {
         // Determine the Activation state by processing the given image dir.
         auto activationState = server::Activation::Activations::Invalid;
-        ItemUpdater::ActivationStatus result =
-            ItemUpdater::validateSquashFSImage(filePath);
+        ItemUpdater::ActivationStatus result;
+        if (purpose == VersionPurpose::BMC || purpose == VersionPurpose::System)
+            result = ItemUpdater::validateSquashFSImage(filePath);
+        else
+            result = ItemUpdater::ActivationStatus::ready;
+
         AssociationList associations = {};
 
         if (result == ItemUpdater::ActivationStatus::ready)