From ed94916f1bfeb685071ee3c5ed9d9912c1929032 Mon Sep 17 00:00:00 2001 From: Yong Li Date: Fri, 13 Dec 2019 17:38:20 +0800 Subject: Implement Software interface to support bios version in redfish bmcweb uses the Software.Activation interface to query the bios version, implement the Software.Activation and Association.Definitions to support the query. Tested: https://$BMCIP/redfish/v1/Systems/system contains the BiosVersion: "BiosVersion": "NA", Change-Id: I77fdefc5962bfc7715b125ccfec0ec57e9dd0f55 Signed-off-by: Yong Li --- settings/include/defaults.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/settings/include/defaults.hpp b/settings/include/defaults.hpp index 134e9a0..4e7ea39 100644 --- a/settings/include/defaults.hpp +++ b/settings/include/defaults.hpp @@ -17,6 +17,8 @@ #pragma once #include "interface.hpp" +using Association = std::tuple; + // this file is vendor specific, other vendors should replace this file using a // bbappend @@ -172,11 +174,36 @@ inline void loadSettings(sdbusplus::asio::object_server &objectServer, setting->addProperty("UUID", "00000000-0000-0000-0000-000000000000"); + // TODO needs to remove the below BiosId after the refernce in ipmi oem is + // change to Version property setting = &settings.emplace_back(objectServer, "/xyz/openbmc_project/bios", "xyz.openbmc_project.Inventory.Item.Bios"); setting->addProperty("BiosId", "NA"); + setting = &settings.emplace_back(objectServer, + "/xyz/openbmc_project/software/bios", + "xyz.openbmc_project.Software.Version"); + setting->addProperty("Version", "NA"); + setting->addProperty( + "Purpose", "xyz.openbmc_project.Software.Version.VersionPurpose.Host"); + + setting = &settings.emplace_back(objectServer, + "/xyz/openbmc_project/software/bios", + "xyz.openbmc_project.Software.Activation"); + setting->addProperty( + "Activation", + "xyz.openbmc_project.Software.Activation.Activations.Active"); + + std::vector associations; + associations.push_back(Association("functional", "software_version", + "/xyz/openbmc_project/software/bios")); + + setting = + &settings.emplace_back(objectServer, "/xyz/openbmc_project/software", + "xyz.openbmc_project.Association.Definitions"); + setting->interface->register_property("Associations", associations); + setting = &settings.emplace_back( objectServer, "/xyz/openbmc_project/control/processor_error_config", "xyz.openbmc_project.Control.Processor.ErrConfig"); -- cgit v1.2.3