Log PEL if System type DTB not supported
System boots up with respective dtb for that system type,
which is based on HW and IM keyword of system VPD.
If any new value comes for these keywords, that needs to be supported
in vpd-parser, otherwise it will log PEL and exit.
This commit is dependent on PDI change-
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/49025
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
Change-Id: I66e43a8aab38511bfaa59641556ea9e58b3f87e2
diff --git a/const.hpp b/const.hpp
index ef0793e..cf50452 100644
--- a/const.hpp
+++ b/const.hpp
@@ -88,6 +88,8 @@
constexpr auto errIntfForEccCheckFail = "com.ibm.VPD.Error.EccCheckFailed";
constexpr auto errIntfForJsonFailure = "com.ibm.VPD.Error.InvalidJson";
constexpr auto errIntfForBusFailure = "com.ibm.VPD.Error.DbusFailure";
+constexpr auto errIntfForInvalidSystemType =
+ "com.ibm.VPD.Error.UnknownSytemType";
constexpr auto motherBoardInterface =
"xyz.openbmc_project.Inventory.Item.Board.Motherboard";
constexpr auto systemVpdFilePath = "/sys/bus/i2c/drivers/at24/8-0050/eeprom";
diff --git a/ibm_vpd_app.cpp b/ibm_vpd_app.cpp
index 7f9e383..43d8280 100644
--- a/ibm_vpd_app.cpp
+++ b/ibm_vpd_app.cpp
@@ -682,8 +682,17 @@
else
{
// System type not supported
- cerr << "This System type not found/supported in dtb table "
- << systemType << ". so system will be booted with default dtb.\n";
+ string err = "This System type not found/supported in dtb table " +
+ systemType +
+ ".Please check the HW and IM keywords in the system "
+ "VPD.Breaking...";
+
+ // map to hold additional data in case of logging pel
+ PelAdditionalData additionalData{};
+ additionalData.emplace("DESCRIPTION", err);
+ createPEL(additionalData, PelSeverity::WARNING,
+ errIntfForInvalidSystemType);
+ exit(-1);
}
string readVarValue;