PEL: Update serverFWRelVer in ext user header section
The Extended User Header section has a field for server
firmware version. Get this field updated from os-release.
Test: Verified PEL tool output for ext user header section
Signed-off-by: Sumit Kumar <sumit_kumar@in.ibm.com>
Change-Id: I24cf7a44d71f8afaac3f1d1073fe2a5e13d46628
diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index c3ca67c..59a0d85 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -224,7 +224,13 @@
void DataInterface::readServerFWVersion()
{
- // Not available yet
+ auto value =
+ phosphor::logging::util::getOSReleaseValue("VERSION_ID").value_or("");
+ if ((value != "") && (value.find_last_of(')') != std::string::npos))
+ {
+ std::size_t pos = value.find_first_of('(') + 1;
+ _serverFWVersion = value.substr(pos, value.find_last_of(')') - pos);
+ }
}
void DataInterface::readBMCFWVersionID()