OpenPOWER: Add support for Hostboot dump.

Hostboot dump is a dump created during the boot failure
on OpenPOWER based systems.
The dump get extracted from Self Boot Engine(SBE) with
the openpower-dump-manager application.
That application will call into phosphor-dump-manager
to create a dump with the data collected from each
SBE in the system.

Role of phosphor-debug-collector hostboot dump manager

 - Create the hostboot dump package directory
 - Create hostboot dump entry
 - Implement notify interface to get notified when the
   collection is completed
 - Once notified collect each file from the predefined
   location and package it into a dump.
 - Update the hostboot dump entry with details once
   dump packaging is completed.

Tested:
- Create a dump entry with busctl
- create a dummy file in search path
- Call notify with busctl

Signed-off-by: Dhruvaraj Subhshchandran <dhruvaraj@in.ibm.com>
Change-Id: I2dab3b7ca976ed33184f770722cca00b1b02c075
diff --git a/dump-extensions/openpower-dumps/dump-extensions.cpp b/dump-extensions/openpower-dumps/dump-extensions.cpp
index 45864ca..3b91842 100644
--- a/dump-extensions/openpower-dumps/dump-extensions.cpp
+++ b/dump-extensions/openpower-dumps/dump-extensions.cpp
@@ -4,21 +4,52 @@
 
 #include "dump-extensions/openpower-dumps/openpower_dumps_config.h"
 
+#include "com/ibm/Dump/Entry/Hardware/server.hpp"
+#include "com/ibm/Dump/Entry/Hostboot/server.hpp"
+#include "com/ibm/Dump/Entry/SBE/server.hpp"
+#include "dump_manager_hostdump.hpp"
 #include "dump_manager_resource.hpp"
 #include "dump_manager_system.hpp"
+#include "dump_utils.hpp"
+#include "host_dump_entry.hpp"
+
+#include <fmt/core.h>
+
+#include <phosphor-logging/log.hpp>
 
 namespace phosphor
 {
 namespace dump
 {
 
-void loadExtensions(sdbusplus::bus_t& bus, DumpManagerList& dumpList)
+using namespace phosphor::logging;
+void loadExtensions(sdbusplus::bus::bus& bus,
+                    const phosphor::dump::EventPtr& event,
+                    DumpManagerList& dumpList)
 {
-
     dumpList.push_back(std::make_unique<openpower::dump::system::Manager>(
         bus, SYSTEM_DUMP_OBJPATH, SYSTEM_DUMP_OBJ_ENTRY));
     dumpList.push_back(std::make_unique<openpower::dump::resource::Manager>(
         bus, RESOURCE_DUMP_OBJPATH, RESOURCE_DUMP_OBJ_ENTRY));
+
+    try
+    {
+        std::filesystem::create_directories(HOSTBOOT_DUMP_PATH);
+    }
+    catch (std::exception& e)
+    {
+        log<level::ERR>(
+            fmt::format("Failed to create hostboot dump directory({})",
+                        HOSTBOOT_DUMP_PATH)
+                .c_str());
+        throw std::runtime_error("Failed to create hostboot dump directory");
+    }
+    dumpList.push_back(std::make_unique<openpower::dump::hostdump::Manager<
+                           sdbusplus::com::ibm::Dump::Entry::server::Hostboot>>(
+        bus, event, HOSTBOOT_DUMP_OBJPATH, HOSTBOOT_DUMP_OBJ_ENTRY,
+        HOSTBOOT_DUMP_PATH, "hbdump", HOSTBOOT_DUMP_TMP_FILE_DIR,
+        HOSTBOOT_DUMP_MAX_SIZE, HOSTBOOT_DUMP_MIN_SPACE_REQD,
+        HOSTBOOT_DUMP_TOTAL_SIZE));
 }
 } // namespace dump
 } // namespace phosphor