oem-ibm: Support bios attributes for boot types
This commit adds support to two bios attributes, boot
initiator and boot type, which lets the host know who
initiated the boot through boot initiator, and what type of
boot(boot or reboot) through the boot type attribute
Change-Id: Iec4bc4ceec3a48ffd3f59b4d31f419c8806187ac
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
index 895c9f2..52769ab 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.hpp
@@ -122,7 +122,7 @@
pldm::utils::DBusHandler::getBus(),
propertiesChanged("/xyz/openbmc_project/state/chassis0",
"xyz.openbmc_project.State.Chassis"),
- [](sdbusplus::message_t& msg) {
+ [this](sdbusplus::message_t& msg) {
pldm::utils::DbusChangedProps props{};
std::string intf;
msg.read(intf, props);
@@ -134,6 +134,7 @@
if (propVal ==
"xyz.openbmc_project.State.Chassis.PowerState.Off")
{
+ handleBootTypesAtChassisOff();
static constexpr auto searchpath =
"/xyz/openbmc_project/inventory/system/chassis/motherboard";
int depth = 0;
@@ -363,6 +364,19 @@
*/
void setSurvTimer(uint8_t tid, bool value);
+ /** @brief To handle the boot types bios attributes at power on*/
+ void handleBootTypesAtPowerOn();
+
+ /** @brief To handle the boot types bios attributes at shutdown*/
+ void handleBootTypesAtChassisOff();
+
+ /** @brief To set the boot types bios attributes based on the RestartCause
+ * of host
+ *
+ * @param[in] RestartCause - Host restart cause
+ */
+ void setBootTypesBiosAttr(const std::string& restartCause);
+
~Handler() = default;
pldm::responder::CodeUpdate* codeUpdate; //!< pointer to CodeUpdate object