diff options
author | Geremy Condra <gcondra@google.com> | 2014-02-06 19:45:10 -0800 |
---|---|---|
committer | Geremy Condra <gcondra@google.com> | 2014-02-20 12:54:17 -0800 |
commit | 36bd365625e6beba77698a93795a603180a5b476 (patch) | |
tree | 88e2ef7fa53403531438435e87326e3f4b5ca9d1 /tools/releasetools/edify_generator.py | |
parent | d3579f4ee0135f0a9636adb963704cc8d5c041e1 (diff) | |
download | build-36bd365625e6beba77698a93795a603180a5b476.zip build-36bd365625e6beba77698a93795a603180a5b476.tar.gz build-36bd365625e6beba77698a93795a603180a5b476.tar.bz2 |
Add support for block incremental OTAs
Change-Id: Ie72015e34ed8d7595a5c74c8df41cba73275afab
Diffstat (limited to 'tools/releasetools/edify_generator.py')
-rw-r--r-- | tools/releasetools/edify_generator.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py index 426b713..a5340a0 100644 --- a/tools/releasetools/edify_generator.py +++ b/tools/releasetools/edify_generator.py @@ -81,6 +81,18 @@ class EdifyGenerator(object): ) % (" or ".join(fp),) self.script.append(cmd) + def AssertRecoveryFingerprint(self, *fp): + """Assert that the current recovery build fingerprint is one of *fp.""" + if not fp: + raise ValueError("must specify some fingerprints") + cmd = ( + ' ||\n '.join([('getprop("ro.build.fingerprint") == "%s"') + % i for i in fp]) + + ' ||\n abort("Package expects build fingerprint of %s; this ' + 'device has " + getprop("ro.build.fingerprint") + ".");' + ) % (" or ".join(fp),) + self.script.append(cmd) + def AssertOlderBuild(self, timestamp, timestamp_text): """Assert that the build on the device is older (or the same as) the given timestamp.""" @@ -296,3 +308,8 @@ class EdifyGenerator(object): data = open(os.path.join(input_path, "updater")).read() common.ZipWriteStr(output_zip, "META-INF/com/google/android/update-binary", data, perms=0755) + + def Syspatch(self, filename, size, target_sha, source_sha, patchfile): + """Applies a compressed binary patch to a block device.""" + call = 'syspatch("%s", "%s", "%s", "%s", "%s");' + self.script.append(call % (filename, size, target_sha, source_sha, patchfile)) |