faft: Reload the firmware image after we modify it
Because we cache the firmware image in the FAFTClient class, we should reload
it after any modification. Otherwise, it causes issues, like multiple GBB flags
clearing.
BUG=chromium-os:32973
TEST=flash the firmware image from buildbot and
run firmware_RollbackFirmware/control.dev passed.
Change-Id: Ida1f150093296ca9dac8e895c076d6a1a9b53113
Reviewed-on: https://gerrit.chromium.org/gerrit/28476
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
diff --git a/client/cros/faft_client.py b/client/cros/faft_client.py
index c1f09bc..0d97e8d 100644
--- a/client/cros/faft_client.py
+++ b/client/cros/faft_client.py
@@ -49,6 +49,9 @@
self._load()
return getattr(self._obj, name)
+ def reload(self):
+ self._loaded = False
+
class FAFTClient(object):
"""A class of FAFT client which aggregates some useful functions of SAFT.
@@ -251,6 +254,11 @@
return self._bios_handler.get_section_flags(section)
+ def reload_firmware(self):
+ """Reload the firmware image that may be changed."""
+ self._bios_handler.reload()
+
+
@allow_multiple_section_input
def corrupt_EC(self, section):
"""Corrupt the requested EC section signature.