Add BIOS DBus object

When HOST_BIOS_UPGRADE is enabled, create the "default" BIOS DBus object
so that it could be used for other services.
Typically, the BIOS version is sent from BIOS via OEM ipmi command, and
the oem handler could set the BIOS version accordingly.

When the BIOS is updated, this service could directly set the BIOS
version as well.

Tested: Verify the BIOS activation/version object is created on DBus.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I10d7b9a035d6a6f649fc5950f37e8fdb0db70176
diff --git a/item_updater.hpp b/item_updater.hpp
index 721d371..b2185b9 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -62,6 +62,9 @@
         setBMCInventoryPath();
         processBMCImage();
         restoreFieldModeStatus();
+#ifdef HOST_BIOS_UPGRADE
+        createBIOSObject();
+#endif
         emit_object_added();
     };
 
@@ -253,6 +256,22 @@
      */
     bool checkImage(const std::string& filePath,
                     const std::vector<std::string>& imageList);
+
+#ifdef HOST_BIOS_UPGRADE
+    /** @brief Create the BIOS object without knowing the version.
+     *
+     *  The object is created only to provide the DBus access so that an
+     *  external service could set the correct BIOS version.
+     *  On BIOS code update, the version is updated accordingly.
+     */
+    void createBIOSObject();
+
+    /** @brief Persistent Activation D-Bus object for BIOS */
+    std::unique_ptr<Activation> biosActivation;
+
+    /** @brief Persistent Version D-Bus object for BIOS */
+    std::unique_ptr<VersionClass> biosVersion;
+#endif
 };
 
 } // namespace updater