summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch')
-rw-r--r--meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch
new file mode 100644
index 000000000..94af67967
--- /dev/null
+++ b/meta-openbmc-mods/meta-common/recipes-phosphor/configuration/entity-manager/0003-Add-logs-to-fwVersionIsSame.patch
@@ -0,0 +1,56 @@
+From 28525b56161e1b659e85e85c33fc00dc397758aa Mon Sep 17 00:00:00 2001
+From: Helen Huang <he.huang@intel.com>
+Date: Mon, 19 Apr 2021 16:06:15 +0800
+Subject: [PATCH] Add logs to fwVersionIsSame()
+
+Add logs to fwVersionIsSame() to indicate whether the firmware
+version is changed or not.
+
+Tested:
+Logs are printed as expected when firmware updating and BMC rebooting.
+
+Log of rebooting:
+The firmware version is similiar as the last boot,
+Hash value of versionFile is:3336889560
+
+Log of Firmware update:
+The firmware version is changed since the last boot,
+hash value of current versionFile is:3336889560,
+hash value of versionFile of last boot is:834871226
+
+Change-Id: I5306917329d2e2e015af58cad1e9c59881f0b217
+Signed-off-by: Helen Huang <he.huang@intel.com>
+---
+ include/Utils.hpp | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/include/Utils.hpp b/include/Utils.hpp
+index 657af92..8238807 100644
+--- a/include/Utils.hpp
++++ b/include/Utils.hpp
+@@ -116,13 +116,22 @@ inline bool fwVersionIsSame(void)
+
+ if (expectedHash == hashString)
+ {
++ std::cout << "The firmware version is similiar as the last boot, "
++ "hash value of versionFile is:"
++ << hashString.c_str() << "\n";
+ return true;
+ }
++ std::cout << "The firmware version is changed since the last boot, hash "
++ "value of current versionFile is:"
++ << expectedHash.c_str()
++ << ", hash value of versionFile of last boot is:"
++ << hashString.c_str() << "\n";
+ hashFile.close();
+ }
+
+ std::ofstream output(versionHashFile);
+ output << expectedHash;
++
+ return false;
+ }
+
+--
+2.17.1
+