summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAppaRao Puli <apparao.puli@linux.intel.com>2019-12-17 23:07:02 +0300
committerPuli, Apparao <apparao.puli@intel.com>2019-12-19 15:34:29 +0300
commitd41ddd78dd631dd2e8774457defa407d9bf03374 (patch)
treec82abe022e09a94adeee378effe952a992d90729
parent1b35e8872bcd4f5abe0a52641e361c3fd68e0810 (diff)
downloadprovingground-d41ddd78dd631dd2e8774457defa407d9bf03374.tar.xz
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>
-rw-r--r--intel-pfr-manager/service/src/pfr_mgr.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/intel-pfr-manager/service/src/pfr_mgr.cpp b/intel-pfr-manager/service/src/pfr_mgr.cpp
index b773916..c954f96 100644
--- a/intel-pfr-manager/service/src/pfr_mgr.cpp
+++ b/intel-pfr-manager/service/src/pfr_mgr.cpp
@@ -55,22 +55,28 @@ PfrVersion::PfrVersion(sdbusplus::asio::object_server &srv_,
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)
- {
- activation =
- "xyz.openbmc_project.Software.Activation.Activations.StandbySpare";
- }
- else
+ std::string activation =
+ "xyz.openbmc_project.Software.Activation.Activations.StandbySpare";
+
+ if ((imgType == ImageType::bmcActive) ||
+ (imgType == ImageType::biosActive) ||
+ (imgType == ImageType::cpldActive))
{
+ // 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 =