vpd-tool mfgClean: implement sync BIOS attributes
This commit implements --syncBiosAttributes feature in vpd-tool
--mfgClean. When --syncBiosAttributes is selected along with --mfgClean,
the VPD keywords which are used for backing up BIOS attributes are
updated with the BIOS attribute values read from BIOS Config Manager
service.
Test:
```
- Install BMC image on rainier_2s2u.
- Reboot and wait for BMC to reach Ready state.
- Using vpd-tool, check the value of all the System VPD keywords used
for backing up BIOS attributes both on EEPROM and on D-Bus.
- Run vpd-tool --mfgClean --syncBiosAttributes/-s --yes
- Check return code
- Use pldmtool to check the current values of respective BIOS attributes
- Use vpd-tool, check the value of all the System VPD keywords used for
backing up BIOS attributes, both on EEPROM and on D-Bus.
- The VPD values should correspond with the BIOS attribute values.
- For all other keywords for which --mfgClean applies, the value on
EEPROM and D-Bus should be the default value from the respective
backup_restore JSON file.
```
Change-Id: I57c5df6ac0b3c4c91533d1ef22e69efcd4c87162
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
diff --git a/vpd-tool/include/vpd_tool.hpp b/vpd-tool/include/vpd_tool.hpp
index 0004949..ed2aa00 100644
--- a/vpd-tool/include/vpd_tool.hpp
+++ b/vpd-tool/include/vpd_tool.hpp
@@ -217,8 +217,19 @@
* @throw std::terminate, std::bad_alloc
*/
types::BinaryVector getVpdValueInBiosConfigManager(
- [[maybe_unused]] const std::string& i_recordName,
- [[maybe_unused]] const std::string& i_keywordName) const;
+ const std::string& i_recordName,
+ const std::string& i_keywordName) const;
+
+ /**
+ * @brief VPD keyword to BIOS attribute map
+ *
+ * This map specifies which VPD keyword is used to backup which BIOS
+ * attribute.
+ * {Record, Keyword} -> {attribute name, number of bits in keyword, starting
+ * bit position, enabled value, disabled value}
+ *
+ */
+ static const types::BiosAttributeKeywordMap m_biosAttributeVpdKeywordMap;
public:
/**