Populate MinimumVersion property
The Minimum Version is now an available D-Bus interface:
```
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/70110
```
Populate its value if it's being defined.
Tested: If the msl meson options are defined, the D-Bus property is
populated with the value of the defined minimum version:
```
root@witherspoon:~# busctl get-property xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software xyz.openbmc_project.Software.MinimumVersion MinimumVersion
s "2.15.0"
```
Change-Id: I0f9df0cfd7c06794df836e161b3416094a8535de
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/msl_verify.cpp b/msl_verify.cpp
index c9f8bce..8dd30a0 100644
--- a/msl_verify.cpp
+++ b/msl_verify.cpp
@@ -59,9 +59,7 @@
bool minimum_ship_level::verify(const std::string& versionManifest)
{
// If there is no msl or mslRegex return upgrade is needed.
- std::string msl{BMC_MSL};
- std::string mslRegex{REGEX_BMC_MSL};
- if (msl.empty() || mslRegex.empty())
+ if (!enabled())
{
return true;
}
@@ -69,6 +67,7 @@
// Define mslVersion variable and populate in Version format
// {major,minor,rev} using parse function.
+ std::string msl = getMinimumVersion();
Version mslVersion = {0, 0, 0};
parse(msl, mslVersion);
@@ -104,3 +103,19 @@
return true;
}
+
+bool minimum_ship_level::enabled()
+{
+ std::string msl = getMinimumVersion();
+ std::string mslRegex{REGEX_BMC_MSL};
+ if (!msl.empty() && !mslRegex.empty())
+ {
+ return true;
+ }
+ return false;
+}
+
+std::string minimum_ship_level::getMinimumVersion()
+{
+ return BMC_MSL;
+}