obmc-flash-bmc: Add ExecStartPre and Post to update environment variables
Backup the environment variables before performing an update.
Update the environment variables that point to the new volumes only
if all the ExecStart commands are successful. Also ensure that the
volumes exist so that the env variables point to an existing volume.
Change-Id: I4f63076730f0843677b6ac8bf166c02ae36eaf2e
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service
index 7c2a252..98366fd 100644
--- a/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service
+++ b/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service
@@ -4,7 +4,9 @@
[Service]
Type=oneshot
RemainAfterExit=no
+ExecStartPre=/usr/bin/env obmc-flash-bmc preupdate
ExecStart=/usr/bin/env obmc-flash-bmc ubiro {RO_MTD} rofs-%i %i
ExecStart=/usr/bin/env obmc-flash-bmc ubikernel {KERNEL_MTD} kernel-%i %i
ExecStart=/usr/bin/env obmc-flash-bmc mtduboot u-boot %i
+ExecStartPost=/usr/bin/env obmc-flash-bmc postupdate %i
SyslogIdentifier=obmc-flash-bmc