diff options
author | Yong Li <yong.b.li@linux.intel.com> | 2019-12-13 12:38:20 +0300 |
---|---|---|
committer | Li, Yong B <yong.b.li@intel.com> | 2019-12-18 03:56:21 +0300 |
commit | ed94916f1bfeb685071ee3c5ed9d9912c1929032 (patch) | |
tree | a508832a0d0563d8c37610f73b0ab04e1061e18b | |
parent | 007a2cb0191757290f959aaaa20842db860b3fe6 (diff) | |
download | provingground-ed94916f1bfeb685071ee3c5ed9d9912c1929032.tar.xz |
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 <yong.b.li@linux.intel.com>
-rw-r--r-- | settings/include/defaults.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
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<std::string, std::string, std::string>; + // 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<Association> 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"); |