Make MaxBootCycleCount Configurable
MaxBootCycleCount is a dbus property that is used to indicate
the maximum number of boot cycles that the post-code-manager
daemon can store the progress codes for, before it starts
wrapping.
Right now the MaxBootCycleCount is hardcoded to 100 in the code.
It should ideally be a configurable variable per platform so that
vendors can choose how may progress codes that we want to store.
Tested By:
1. Default configuration should set the value to 100 - PASSED.
2. Override the value to any number out of 1-100 and the cmake
configuration step should throw an error - PASSED
3. Override the value to any number in between 1-100, and patch
the daemon ,and make sure that MaxBootCycleCount value is set
to the configured value.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: Ic07087a9d6696412e1e6c54fb9945b91f3c560dc
diff --git a/inc/post_code.hpp b/inc/post_code.hpp
index 05ce284..08b1cc5 100644
--- a/inc/post_code.hpp
+++ b/inc/post_code.hpp
@@ -33,8 +33,6 @@
#include <xyz/openbmc_project/State/Boot/PostCode/server.hpp>
#include <xyz/openbmc_project/State/Host/server.hpp>
-#define MaxPostCodeCycles 100
-
const static constexpr char *CurrentBootCycleCountName =
"CurrentBootCycleCount";
const static constexpr char *CurrentBootCycleIndexName =
@@ -177,7 +175,7 @@
fs::path(strPostCodeListPath + strCurrentBootCycleCountName),
count);
currentBootCycleCount(count);
- maxBootCycleNum(MaxPostCodeCycles);
+ maxBootCycleNum(MAX_BOOT_CYCLE_COUNT);
}
~PostCode()
{