pldm: Build BIOS Table Lazily
Entity manager service hosts the compatible interface and populates the
Names property with the chassis type. It is seen that the Names property
is updated pretty late on the way to BMC ready state. And by that time
pldmd is already creating the bios table assuming that the system type
is not detected.
To fix this behavior, rather than creating the bios table early, we need
to wait until we get the system type from the entity manager daemon.
System Type is fetched from Entity Manager Decorator.Compatible
interface [1].
PLDM registers the service name only after building the BIOS tables, to
avoids failures to bios updates from other applications
Tested: Power off/On successfully in Simulator
[1] https://github.com/openbmc/entity-manager/commit/9bac6409d4bd684f058517f41de33ba1d17e5666
Change-Id: I4d431061eaaf8842f6382c2e83807f725653e19b
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/libpldmresponder/bios.cpp b/libpldmresponder/bios.cpp
index a6c0c99..48a3f28 100644
--- a/libpldmresponder/bios.cpp
+++ b/libpldmresponder/bios.cpp
@@ -71,13 +71,12 @@
Handler::Handler(
int fd, uint8_t eid, pldm::InstanceIdDb* instanceIdDb,
pldm::requester::Handler<pldm::requester::Request>* handler,
- pldm::responder::platform_config::Handler* platformConfigHandler) :
+ pldm::responder::platform_config::Handler* platformConfigHandler,
+ pldm::responder::bios::Callback requestPLDMServiceName) :
biosConfig(BIOS_JSONS_DIR, BIOS_TABLES_DIR, &dbusHandler, fd, eid,
- instanceIdDb, handler, platformConfigHandler)
+ instanceIdDb, handler, platformConfigHandler,
+ requestPLDMServiceName)
{
- biosConfig.removeTables();
- biosConfig.buildTables();
-
handlers.emplace(
PLDM_SET_DATE_TIME,
[this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {