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/CMakeLists.txt b/CMakeLists.txt
index 7c68a66..6d291cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,9 +15,15 @@
set(DBUS_OBJECT_NAME "xyz/openbmc_project/State/Boot/PostCode0")
set(DBUS_INTF_NAME "xyz.openbmc_project.State.Boot.PostCode")
+set(MAX_BOOT_CYCLE_COUNT 100 CACHE STRING "Max boot count Value")
+if(NOT MAX_BOOT_CYCLE_COUNT MATCHES "^([1-9][0-9]?|100)$")
+ message(FATAL_ERROR "Maximum boot cycle count must be a number from 1 to 100")
+endif()
add_definitions(-DDBUS_OBJECT_NAME="/${DBUS_OBJECT_NAME}")
add_definitions(-DDBUS_INTF_NAME="${DBUS_INTF_NAME}")
+add_definitions(-DMAX_BOOT_CYCLE_COUNT=${MAX_BOOT_CYCLE_COUNT})
+
set(SRC_FILES src/post_code.cpp
src/main.cpp )
set ( SERVICE_FILES