nicole: Apply pwr restore policy on cold boot only

Makes the phosphor-discover-system-state running only on cold BMC boot.
As a result, on the warm BMC reboot the host's power restore policy
will not be applied.

Tested:
 - on the warm BMC reboot the host power state is not changed.
 - on the cold BMC boot (power cycle) the host power state depends on
   the power restore policy.

Change-Id: I19f6df0a2992a55a8b3a16c38785bca7730e070b
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
diff --git a/meta-nicole/recipes-phosphor/state/phosphor-state-manager/resetreason.conf b/meta-nicole/recipes-phosphor/state/phosphor-state-manager/resetreason.conf
new file mode 100644
index 0000000..828d98b
--- /dev/null
+++ b/meta-nicole/recipes-phosphor/state/phosphor-state-manager/resetreason.conf
@@ -0,0 +1,2 @@
+[Unit]
+ConditionKernelCommandLine=resetreason=power
diff --git a/meta-nicole/recipes-phosphor/state/phosphor-state-manager_%.bbappend b/meta-nicole/recipes-phosphor/state/phosphor-state-manager_%.bbappend
new file mode 100644
index 0000000..dcf8cac
--- /dev/null
+++ b/meta-nicole/recipes-phosphor/state/phosphor-state-manager_%.bbappend
@@ -0,0 +1,5 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+DEPS_CFG = "resetreason.conf"
+DEPS_TGT = "phosphor-discover-system-state@.service"
+SYSTEMD_OVERRIDE_${PN}-discover_append = "${DEPS_CFG}:${DEPS_TGT}.d/${DEPS_CFG}"