[PATCH skeleton v2 1/3] bmc_update: save runtime modified u-boot environment

OpenBMC Patches openbmc-patches at stwcx.xyz
Fri Jul 1 09:30:53 AEST 2016


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

Copy the version saved by our initfs and pointed to by our fw_setenv
tools via /etc/fw_setenv.  Do this copy by default.

The /etc/fw_env.cnf config file points to /run/fw_env in our systems.

The bmc_update object was copying /dev/mtd2.  That could be very
system specific, and it misses any changes made from elsewhere
in the system.

This variable causes the u-boot environment to be written back
after writing the whole image.  This will save the ethernet mac
which for systems which don't store it elsewhere.

Signed-off-by: Milton Miller <miltonm at us.ibm.com>
---
 pyflashbmc/bmc_update.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pyflashbmc/bmc_update.py b/pyflashbmc/bmc_update.py
index 9fa54ac..cd2f3c1 100644
--- a/pyflashbmc/bmc_update.py
+++ b/pyflashbmc/bmc_update.py
@@ -32,7 +32,7 @@ class BmcFlashControl(DbusProperties,DbusObjectManager):
 		
 		self.Set(DBUS_NAME,"status","Idle")
 		self.Set(DBUS_NAME,"filename","")
-		self.Set(DBUS_NAME,"preserve_network_settings",False)
+		self.Set(DBUS_NAME,"preserve_network_settings",True)
 		self.Set(DBUS_NAME,"restore_application_defaults",False)
 		self.Set(DBUS_NAME,"update_kernel_and_apps",False)
 		self.Set(DBUS_NAME,"clear_persistent_files",False)
@@ -114,7 +114,7 @@ class BmcFlashControl(DbusProperties,DbusObjectManager):
 				os.unlink(UPDATE_PATH+"/whitelist")
 			if (self.Get(DBUS_NAME,"preserve_network_settings") == True):
 				print "Preserving network settings"
-				shutil.copy2("/dev/mtd2",UPDATE_PATH+"/image-u-boot-env")
+				shutil.copy2("/run/fw_env",UPDATE_PATH+"/image-u-boot-env")
 				
 		except Exception as e:
 			print e
-- 
2.9.0




More information about the openbmc mailing list