PFR: Adding functional endpoints assosications
Added functional endpoints assosications to all "Active" image
objects like bmc_active, bios_active, cpld_active. This will
make bmcweb happy while querying active component versions.
Tested:
Flashed PFR image and from redfish checked the BMC active version
info by querying "/redfish/v1/Managers/bmc".
Change-Id: Ief7b8f92be3a24c06ef172bf0d9d7a95bce32c15
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/service/src/pfr_mgr.cpp b/service/src/pfr_mgr.cpp
index b773916..c954f96 100644
--- a/service/src/pfr_mgr.cpp
+++ b/service/src/pfr_mgr.cpp
@@ -55,22 +55,28 @@
versionIface->initialize();
- /* Activation interface represents activation state for an associated
- * xyz.openbmc_project.Software.Version. since these versions are already
- * active, so we should set "activation" to Active and
- * "RequestedActivation" to None. */
- std::string activation;
- if (imgType == ImageType::bmcRecovery ||
- imgType == ImageType::biosRecovery ||
- imgType == ImageType::cpldRecovery)
+ std::string activation =
+ "xyz.openbmc_project.Software.Activation.Activations.StandbySpare";
+
+ if ((imgType == ImageType::bmcActive) ||
+ (imgType == ImageType::biosActive) ||
+ (imgType == ImageType::cpldActive))
{
- activation =
- "xyz.openbmc_project.Software.Activation.Activations.StandbySpare";
- }
- else
- {
+ // Running images so set Activations to "Active"
activation =
"xyz.openbmc_project.Software.Activation.Activations.Active";
+
+ /* For all Active images, functional endpoints must be added. This *
+ * will be used in bmcweb for showing active component versions. */
+ using Association = std::tuple<std::string, std::string, std::string>;
+ std::vector<Association> associations;
+ associations.push_back(
+ Association("functional", "software_version", objPath));
+ auto associationsIface =
+ server.add_interface("/xyz/openbmc_project/software",
+ "xyz.openbmc_project.Association.Definitions");
+ associationsIface->register_property("Associations", associations);
+ associationsIface->initialize();
}
std::string reqActNone =