VPD Tool: Write keyword command line interface
This commit has the command line interface
for writeKeyword option in the VPD tool.
--help option will provide the user - the argument format
for writeKeyword option.
Note:
The application "vpd-manager" acts as the backend for the keyword updation.
The vpd-manager executable should run in the background while testing in simics.
The commits which points to the vpd-manager backend application are,
< https://gerrit.openbmc-project.xyz/c/openbmc/openpower-vpd-parser/+/28991/43 >
< https://gerrit.openbmc-project.xyz/c/openbmc/openpower-vpd-parser/+/29039/43 >
< https://gerrit.openbmc-project.xyz/c/openbmc/openpower-vpd-parser/+/32439/10 >
Tested on rainier:
root@rainier:/tmp# ./vpd-tool -r -O /system/chassis/motherboard/vdd_vrm1 -R VINI -K FN
{
"/system/chassis/motherboard/vdd_vrm1": {
"FN": "F190827"
}
}
root@rainier:/tmp#
root@rainier:/tmp# ./vpd-tool -w -O /system/chassis/motherboard/vdd_vrm1 -R VINI -K FN -V 0x616263
root@rainier:/tmp#
root@rainier:/tmp# ./vpd-tool -r -O /system/chassis/motherboard/vdd_vrm1 -R VINI -K FN
{
"/system/chassis/motherboard/vdd_vrm1": {
"FN": "abc0827"
}
}
Change-Id: I6c586a9848497e44bf88eda78694989d0287cbba
Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
diff --git a/vpd_tool_impl.hpp b/vpd_tool_impl.hpp
index d31bc25..6c9cf12 100644
--- a/vpd_tool_impl.hpp
+++ b/vpd_tool_impl.hpp
@@ -12,6 +12,7 @@
const std::string fruPath;
const std::string recordName;
const std::string keyword;
+ const std::string value;
/**
* @brief Debugger
@@ -127,6 +128,14 @@
void readKeyword();
/**
+ * @brief Update Keyword
+ * Update the given keyword with the given value.
+ *
+ * @return return code (Success(0)/Failure(-1))
+ */
+ int updateKeyword();
+
+ /**
* @brief A Constructor
* Constructor is called during the
* object instantiation for dumpInventory option.
@@ -155,4 +164,18 @@
recordName(std::move(recName)), keyword(std::move(kw))
{
}
+
+ /**
+ * @brief Constructor
+ * Constructor is called during the
+ * object instantiation for updateKeyword option.
+ */
+
+ VpdTool(const std::string&& fru, const std::string&& recName,
+ const std::string&& kw, const std::string&& val) :
+ fruPath(std::move(fru)),
+ recordName(std::move(recName)), keyword(std::move(kw)),
+ value(std::move(val))
+ {
+ }
};