Add Chassis POH Counter
Added 32-bit counter, which shows how many hours the system has been
running. The value is a cumulative one and includes all working hours
since production. If the chassis state is Powered-on, This will be
incremented by one for every hour. It won't get updated when the
chassis state is powered-off.
Resolves openbmc/openbmc#2979
Change-Id: I18e9bb571d1a6e401b25450168249f70891be665
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
diff --git a/configure.ac b/configure.ac
index 8c02dc8..838aaf2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,6 +60,12 @@
AC_DEFINE_UNQUOTED([HOST_STATE_PERSIST_PATH], ["$HOST_STATE_PERSIST_PATH"], \
[Path of file for storing requested host state.])
+AC_ARG_VAR(POH_COUNTER_PERSIST_PATH, [Path of file for storing POH counter.])
+AS_IF([test "x$POH_COUNTER_PERSIST_PATH" == "x"], \
+ [POH_COUNTER_PERSIST_PATH="/var/lib/phosphor-state-manager/POHCounter"])
+AC_DEFINE_UNQUOTED([POH_COUNTER_PERSIST_PATH], ["$POH_COUNTER_PERSIST_PATH"], \
+ [Path of file for storing POH counter.])
+
AC_ARG_VAR(BOOT_COUNT_MAX_ALLOWED, [The maximum allowed reboot count])
AS_IF([test "x$BOOT_COUNT_MAX_ALLOWED" == "x"], [BOOT_COUNT_MAX_ALLOWED=3])
AC_DEFINE_UNQUOTED([BOOT_COUNT_MAX_ALLOWED], [$BOOT_COUNT_MAX_ALLOWED], [The maximum allowed reboot count])