add UnmountAll function to OTA script; support radio images w/path
Three unrelated changes:
- change the add-radio-file makefile function to support adding files
with paths. (The path part of the pathname is stripped off.)
- add an UnmountAll function to the OTA script generation code, so
that we can explicitly unmount everything we've mounted (in addition
to doing it automatically at the end of the script).
- add the updater API version to the info object passed to
device-specific code.
Change-Id: Ia62b15403c1cc8fce8d9910f291450c8077e49f4
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py
index d1902e1..64bd547 100644
--- a/tools/releasetools/edify_generator.py
+++ b/tools/releasetools/edify_generator.py
@@ -213,14 +213,18 @@
"""Append text verbatim to the output script."""
self.script.append(extra)
+ def UnmountAll(self):
+ for p in sorted(self.mounts):
+ self.script.append('unmount("%s");' % (p,))
+ self.mounts = set()
+
def AddToZip(self, input_zip, output_zip, input_path=None):
"""Write the accumulated script to the output_zip file. input_zip
is used as the source for the 'updater' binary needed to run
script. If input_path is not None, it will be used as a local
path for the binary instead of input_zip."""
- for p in sorted(self.mounts):
- self.script.append('unmount("%s");' % (p,))
+ self.UnmountAll()
common.ZipWriteStr(output_zip, "META-INF/com/google/android/updater-script",
"\n".join(self.script) + "\n")