Add system IM keyword to PEL userdata0 section

Read the system IM keyword via dbus and add it to the PEL userdata0 section.

Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: I6a45e0450928e49c8789cc2f93baad03cccf90c7
diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index 59a0d85..faf035d 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -68,6 +68,7 @@
 constexpr auto invMotherboard =
     "xyz.openbmc_project.Inventory.Item.Board.Motherboard";
 constexpr auto viniRecordVPD = "com.ibm.ipzvpd.VINI";
+constexpr auto vsbpRecordVPD = "com.ibm.ipzvpd.VSBP";
 constexpr auto locCode = "com.ibm.ipzvpd.Location";
 constexpr auto compatible =
     "xyz.openbmc_project.Configuration.IBMCompatibleSystem";
@@ -324,6 +325,35 @@
     return ccin;
 }
 
+std::vector<uint8_t> DataInterface::getSystemIMKeyword() const
+{
+    std::vector<uint8_t> systemIM;
+
+    try
+    {
+        auto service =
+            getService(object_path::motherBoardInv, interface::vsbpRecordVPD);
+        if (!service.empty())
+        {
+            DBusValue value;
+            getProperty(service, object_path::motherBoardInv,
+                        interface::vsbpRecordVPD, "IM", value);
+
+            systemIM = std::get<std::vector<uint8_t>>(value);
+        }
+    }
+    catch (const std::exception& e)
+    {
+        log<level::WARNING>(
+            fmt::format("Failed reading System IM property from "
+                        "Interface: {} exception: {}",
+                        interface::vsbpRecordVPD, e.what())
+                .c_str());
+    }
+
+    return systemIM;
+}
+
 void DataInterface::getHWCalloutFields(const std::string& inventoryPath,
                                        std::string& fruPartNumber,
                                        std::string& ccin,