Add updateable association to active BMC FW object
Add 'updateable' association to the active BMC
firmware version object. This 'updateable' association
can be used to mark all the firmware components
which can be programmable from BMC interfaces like
Redfish.
Tested:
- Able to query the updateable endpoint objects.
Req:
busctl call xyz.openbmc_project.ObjectMapper
/xyz/openbmc_project/software/updateable
org.freedesktop.DBus.Properties Get ss
xyz.openbmc_project.Association endpoints
Res:
v as 1 "/xyz/openbmc_project/software/1201fc36"
- Get on FirmwareInventory shows correct value
for 'Updateable' property. Redfish support is
added as new commit.
URI: /redfish/v1/UpdateService/FirmwareInventory/1201fc36
Res: Can see "Updateable": true output
Change-Id: Id74a134dacdea86399d10fbe0a4b0e62728d1cf4
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/item_updater.cpp b/item_updater.cpp
index 4f2b833..7fe69e4 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -221,6 +221,10 @@
createActiveAssociation(path);
}
+ // All updateable firmware components must expose the updateable
+ // association.
+ createUpdateableAssociation(path);
+
// Create Version instance for this version.
auto versionPtr = std::make_unique<VersionClass>(
bus, path, version, purpose, "",
@@ -553,6 +557,13 @@
associations(assocs);
}
+void ItemUpdater::createUpdateableAssociation(const std::string& path)
+{
+ assocs.emplace_back(std::make_tuple(UPDATEABLE_FWD_ASSOCIATION,
+ UPDATEABLE_REV_ASSOCIATION, path));
+ associations(assocs);
+}
+
void ItemUpdater::removeAssociations(const std::string& path)
{
for (auto iter = assocs.begin(); iter != assocs.end();)