Fix DeleteAll to set boot count 0
Currently DeleteAll sets boot count 1 after
DeleteAll next boot shows as boot count 2
and GetPostCodesWithTimeStamp does not show
progress codes for boot count 2 and it continues
This commit fixes this issue.
Tested results:
After DeleteAll:
busctl call xyz.openbmc_project.State.Boot.PostCode0 /xyz/openbmc_project/State/Boot/PostCode0 org.freedesktop.DBus.Properties Get ss xyz.openbmc_project.State.Boot.PostCode CurrentBootCycleCount
v q 0
First Boot after DeleteAll:
busctl call xyz.openbmc_project.State.Boot.PostCode0 /xyz/openbmc_project/State/Boot/PostCode0 org.freedesktop.DBus.Properties Get ss xyz.openbmc_project.State.Boot.PostCode CurrentBootCycleCount
v q 1
busctl call xyz.openbmc_project.State.Boot.PostCode0 /xyz/openbmc_project/State/Boot/PostCode0 xyz.openbmc_project.State.Boot.PostCode GetPostCodesWithTimeStamp q 1
a{t(tay)} 41 1622776305892427 3472328313407551299 72 2 0 0 9 0 0 0 72 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 251 30 215 0 0 0 0 0 0 0 0 67 55 48 48 52 48 48 48 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 1622776307055818 3472328313407551299 72 2 0 0 9 0 0 0 72 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 251 14 215 0 0 0 0 0 0 0 0 67 55 48 48 52 48 48 48 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
Change-Id: Icc4d40fe6fb110f25e1883557acb2d6dfa4b804b
diff --git a/src/post_code.cpp b/src/post_code.cpp
index 31c3e16..c62c389 100644
--- a/src/post_code.cpp
+++ b/src/post_code.cpp
@@ -30,8 +30,8 @@
<< std::endl;
fs::create_directories(dir);
postCodes.clear();
- currentBootCycleIndex = 1;
- currentBootCycleCount(1);
+ currentBootCycleIndex = 0;
+ currentBootCycleCount(0);
}
std::vector<postcode_t> PostCode::getPostCodes(uint16_t index)