summaryrefslogtreecommitdiffstats
path: root/pyflashbmc
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2017-10-02 19:33:48 -0500
committerAdriana Kobylak <anoo@us.ibm.com>2017-10-02 19:44:55 -0500
commit7bef82c0b4fea534a224c4fb1d366664ced81e43 (patch)
tree8f100e835bc7e2bc34bce7e1ae9ef1a980bf6832 /pyflashbmc
parent2b3f3ffef98a0dd56397de2bbd4e5e9e970c4799 (diff)
downloadtalos-skeleton-7bef82c0b4fea534a224c4fb1d366664ced81e43.tar.gz
talos-skeleton-7bef82c0b4fea534a224c4fb1d366664ced81e43.zip
bmc_update.py: Call fw_setenv twice for PrepareForUpdate
Support for u-boot redundant environment variables was added where u-boot alternates writing to each environment every time an variable is written. But initramfs doesn't know which environment is active so it always reads from the same one. Therefore need to twice set the environments that initramfs reads so that they're written to both environments and initramfs can read it. Part of openbmc/openbmc#2292 Change-Id: Ifaa9a55067cdd2f42b534b680809552f6574a56a Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'pyflashbmc')
-rw-r--r--pyflashbmc/bmc_update.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pyflashbmc/bmc_update.py b/pyflashbmc/bmc_update.py
index 56940fe..a83eafe 100644
--- a/pyflashbmc/bmc_update.py
+++ b/pyflashbmc/bmc_update.py
@@ -301,6 +301,13 @@ class BmcFlashControl(DbusProperties, DbusObjectManager):
"fw_setenv",
"openbmconce",
"copy-files-to-ram copy-base-filesystem-to-ram"])
+ # Set the variable twice so that it is written to both environments of
+ # the u-boot redundant environment variables since initramfs can only
+ # read one of the environments.
+ subprocess.call([
+ "fw_setenv",
+ "openbmconce",
+ "copy-files-to-ram copy-base-filesystem-to-ram"])
self.Set(DBUS_NAME, "status", "Switch to update mode in progress")
o = bus.get_object(BMC_DBUS_NAME, BMC_OBJ_NAME)
intf = dbus.Interface(o, BMC_DBUS_NAME)
OpenPOWER on IntegriCloud