[PATCH openbmc v2 33/34] Add clear-once service

OpenBMC Patches openbmc-patches at stwcx.xyz
Tue Mar 8 08:30:22 AEDT 2016


From: "Milton D. Miller II" <miltonm at us.ibm.com>

Create a service unit to clear the openbmconce variable in the
the u-boot environment with fw_setenv.

Set the timeout to allow the flash to be written, even though we
currently just update the ram shadow file.

Signed-off-by: Milton Miller <miltonm at us.ibm.com>
---
 .../common/recipes-phosphor/clear-once/clear-once.bb      |  8 ++++++++
 .../clear-once/clear-once/clear-once.service              | 15 +++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100644 meta-phosphor/common/recipes-phosphor/clear-once/clear-once.bb
 create mode 100644 meta-phosphor/common/recipes-phosphor/clear-once/clear-once/clear-once.service

diff --git a/meta-phosphor/common/recipes-phosphor/clear-once/clear-once.bb b/meta-phosphor/common/recipes-phosphor/clear-once/clear-once.bb
new file mode 100644
index 0000000..61e3c20
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/clear-once/clear-once.bb
@@ -0,0 +1,8 @@
+
+SUMMARY = "Clear boot-once variables"
+DESCRIPTION = "Clear u-boot variables used for one-time boot flow"
+
+RPROVIDES_${PN} += "clear-once"
+
+inherit obmc-phosphor-systemd
+inherit obmc-phosphor-license
diff --git a/meta-phosphor/common/recipes-phosphor/clear-once/clear-once/clear-once.service b/meta-phosphor/common/recipes-phosphor/clear-once/clear-once/clear-once.service
new file mode 100644
index 0000000..a7641e6
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/clear-once/clear-once/clear-once.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Clear one time boot overrides
+
+ConditionFileNotEmpty=/etc/fw_env.config
+RequiresMountsFor=/run /sbin /etc
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+
+# It took 7 seconds to erase and write flash, be conservative
+TimeoutStartSec=60
+Restart=no
+
+ExecStart=/sbin/fw_setenv openbmconce
-- 
2.7.1




More information about the openbmc mailing list