Check for essential FRUs

Some FRUs are marked as essential in the inventory JSON, which
implies that those FRUs should be present in the system at
power on.

The commit checks for presence of those FRUs when the system is
powered on.
In case any FRU in the list is found missing, appropriate
PEL is logged.

Also, as it is not possible to say if the reason for GPIO failures
are hardware or firmware related. GPIO PELs has been modified
to just have description and no call outs and to be logged in place.

Commit link for PEL interface:
https://gerrit.openbmc.org/c/openbmc/phosphor-logging/+/54715

'''
Test steps(rainier):
Check for present property for fru path
/xyz/openbmc_project/inventory/system/chassis/motherboard/base_op_panel_blyth

if it is false then proceed else set the property to false using
busctl set-property command.

execute obmcutil poweron
PEL should be logged for missing essential fru.
'''

Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
Change-Id: Id8b912503a0086beffa2831910d6852b5e473c15
diff --git a/vpd-manager/manager.hpp b/vpd-manager/manager.hpp
index 6d8314b..4992801 100644
--- a/vpd-manager/manager.hpp
+++ b/vpd-manager/manager.hpp
@@ -49,7 +49,10 @@
     Manager(const Manager&) = delete;
     Manager& operator=(const Manager&) = delete;
     Manager(Manager&&) = delete;
-    ~Manager() = default;
+    ~Manager()
+    {
+        sd_bus_unref(sdBus);
+    }
 
     /** @brief Constructor to put object onto bus at a dbus path.
      *  @param[in] bus - Bus connection.
@@ -159,6 +162,13 @@
      */
     void restoreSystemVpd();
 
+    /**
+     * @brief Check for essential fru in the system.
+     * The api check for the presence of FRUs marked as essential and logs PEL
+     * in case they are missing.
+     */
+    void checkEssentialFrus();
+
     /** @brief Persistent sdbusplus DBus bus connection. */
     sdbusplus::bus_t _bus;
 
@@ -177,6 +187,12 @@
 
     // map to hold FRUs which can be replaced at standby
     inventory::ReplaceableFrus replaceableFrus;
+
+    // List of FRUs marked as essential in the system.
+    inventory::EssentialFrus essentialFrus;
+
+    // sd-bus
+    sd_bus* sdBus = nullptr;
 };
 
 } // namespace manager