phosphor-state-manager: add PACKAGECONFIG options
Clearly define the optional features and their defaults within the PSM
repo.
Change-Id: Ibf466d9319b4176c816ef22c4cdbfd8cd693a90b
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-ibm/recipes-phosphor/state/phosphor-state-manager_%.bbappend b/meta-ibm/recipes-phosphor/state/phosphor-state-manager_%.bbappend
index 5c5a580..0c5e914 100644
--- a/meta-ibm/recipes-phosphor/state/phosphor-state-manager_%.bbappend
+++ b/meta-ibm/recipes-phosphor/state/phosphor-state-manager_%.bbappend
@@ -1,10 +1,11 @@
-EXTRA_OEMESON:append:witherspoon = " -Dwarm-reboot=disabled"
+# Witherspoon system does not support warm reboots
+PACKAGECONFIG:append:witherspoon = " no-warm-reboot"
# IBM systems only want power restore when AC loss occurred
-EXTRA_OEMESON:append = " -Donly-run-apr-on-power-loss=true"
+PACKAGECONFIG:append = " only-run-apr-on-power-loss"
# IBM systems only allow boot operations when BMC is Ready
-EXTRA_OEMESON:append = " -Donly-allow-boot-when-bmc-ready=true"
+PACKAGECONFIG:append = " only-allow-boot-when-bmc-ready"
# The scheduled-host-transition package provides support to
# schedule power on and off operations for the host at some
diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb
index d129f4a..5643ee1 100644
--- a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb
+++ b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb
@@ -35,6 +35,19 @@
${PN}-systemd-target-monitor \
"
+PACKAGECONFIG ??= "no-warm-reboot \
+ only-run-apr-on-power-loss \
+ only-boot-when-bmc-ready"
+
+# Disable warm reboots of host
+PACKAGECONFIG[no-warm-reboot] = "-Dwarm-reboot=disabled,-Dwarm-reboot=enabled"
+
+# Only run auto power restore logic if system had ac loss
+PACKAGECONFIG[only-run-apr-on-power-loss] = "-Donly-run-apr-on-power-loss=true,-Donly-run-apr-on-power-loss=false"
+
+# Only allow boot operations when BMC is in Ready state
+PACKAGECONFIG[only-boot-when-bmc-ready] = "-Donly-allow-boot-when-bmc-ready=true,-Donly-allow-boot-when-bmc-ready=false"
+
# The host-check function will check if the host is running
# after a BMC reset.
# The reset-sensor-states function will reset the host