diff options
author | Gabriele M <moto.falcon.git@gmail.com> | 2017-01-22 22:50:11 +0100 |
---|---|---|
committer | Tom Powell <zifnab@zifnab06.net> | 2017-03-15 03:30:14 +0000 |
commit | 77e2f324e773d9ce71decb1a551e059438bcdddf (patch) | |
tree | 81a0153a3f11d2cbf59c101ff7d98880523f72b3 /tools/releasetools/ota_from_target_files.py | |
parent | d12c9ff52d5a320a1f0d9fbdd1014598b2b32541 (diff) | |
download | build-77e2f324e773d9ce71decb1a551e059438bcdddf.zip build-77e2f324e773d9ce71decb1a551e059438bcdddf.tar.gz build-77e2f324e773d9ce71decb1a551e059438bcdddf.tar.bz2 |
Update su binary added with addonsu zip
Generate zips that include the su binary out of the system image
when WITH_SU is not true. This allows to update the binary that
was installed with the addonsu zip.
Note: this requires backuptool to work and user builds are excluded.
Change-Id: Idc905e3397816b7d3701c43bbb809878f0d22b9b
Diffstat (limited to 'tools/releasetools/ota_from_target_files.py')
-rwxr-xr-x | tools/releasetools/ota_from_target_files.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 66db227..682d1a9 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -515,6 +515,15 @@ def CopyInstallTools(output_zip): output_zip.write(install_source, install_target) +def CopyExtra(output_zip): + install_path = os.path.join(OPTIONS.input_tmp, "EXTRA") + for root, subdirs, files in os.walk(install_path): + for f in files: + install_source = os.path.join(root, f) + install_target = os.path.join("extra", os.path.relpath(root, install_path), f) + output_zip.write(install_source, install_target) + + def WriteFullOTAPackage(input_zip, output_zip): # TODO: how to determine this? We don't know what version it will # be installed on top of. For now, we expect the API just won't @@ -620,6 +629,8 @@ else if get_stage("%(bcb_dev)s") == "3/3" then if OPTIONS.backuptool: script.Mount("/system") script.RunBackup("backup") + if OPTIONS.info_dict.get("addonsu_updater") == "true": + CopyExtra(output_zip) script.Unmount("/system") system_progress = 0.75 @@ -709,6 +720,8 @@ else if get_stage("%(bcb_dev)s") == "3/3" then if block_based: script.Mount("/system") script.RunBackup("restore") + if OPTIONS.info_dict.get("addonsu_updater") == "true": + script.AppenSuUpdater() # This must be done after backup restore if block_based: script.Unmount("/system") |