Add storeGroups/restoreGroups method to LED Manager
Use CEREAL to storeGroup/restoreGroups the current state of
asserted groups.
Call storeGroups() when the request comes to add to(remove from)
asserted group.
Call restoreGroups() as part of starting LED Manager daemon.
Tested: Manually set the Asserted property of each group to true,
after rebooting, all property values tested with the busctl command
are still true.
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ibeb1de5f51e3d67e98eeea34764e9efc6d6d8b35
diff --git a/configure.ac b/configure.ac
index 5a9c2e0..f871477 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,10 @@
AS_IF([test "x$LED_JSON_FILE" == "x"], [LED_JSON_FILE="/usr/share/phosphor-led-manager/led-group-config.json"])
AC_DEFINE_UNQUOTED([LED_JSON_FILE], ["$LED_JSON_FILE"], [The LED configuration JSON file])
+AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal])
+AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1])
+AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal])
+
# enable JSON configuration
AC_ARG_ENABLE([use_json],
AS_HELP_STRING([--enable-use_json], [Enable JSON configuration.]))
@@ -79,6 +83,11 @@
AC_DEFINE([LED_USE_JSON],[],[Enable JSON configuration.])
)
+# Path of file for storing the names of asserted groups
+AC_ARG_VAR(SAVED_GROUPS_FILE, [Path of file for storing the names of asserted groups])
+AS_IF([test "x$SAVED_GROUPS_FILE" == "x"], [SAVED_GROUPS_FILE="/var/lib/phosphor-led-manager/savedGroups"])
+AC_DEFINE_UNQUOTED([SAVED_GROUPS_FILE], ["$SAVED_GROUPS_FILE"], [Path of file for storing the names of asserted groups])
+
AC_DEFINE(CALLOUT_FWD_ASSOCIATION, "callout", [The name of the callout's forward association.])
AC_DEFINE(CALLOUT_REV_ASSOCIATION, "fault", [The name of the callout's reverse association.])
AC_DEFINE(ELOG_ENTRY, "entry", [Path element indicates an error log entry under logging namespace.])