diff options
author | Tom Marshall <tdm@cyngn.com> | 2014-12-12 11:51:33 -0800 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-06 18:04:04 -0700 |
commit | 317522d5aeaa6b74a807627da25665223f9920ac (patch) | |
tree | d587b7709dc22dbc3b01612392550306062048e9 /tools/releasetools/ota_from_target_files | |
parent | c295a2f7d175dc9b17efabb777599029a6243012 (diff) | |
download | build-317522d5aeaa6b74a807627da25665223f9920ac.zip build-317522d5aeaa6b74a807627da25665223f9920ac.tar.gz build-317522d5aeaa6b74a807627da25665223f9920ac.tar.bz2 |
build: ota: Support for install tools in /tmp/install
* Anything in OUT/install gets packaged up into the zip and extracted
to /tmp/install immediately after FullOTA_InstallBegin.
* Use /tmp/install in edify scripts and remove code related to using
and manipulating /system for install tools.
Change-Id: I315a3238e36c8d15e26f935e272f7e27dd59c320
Diffstat (limited to 'tools/releasetools/ota_from_target_files')
-rwxr-xr-x | tools/releasetools/ota_from_target_files | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files index 3f2c8d2..e0fc128 100755 --- a/tools/releasetools/ota_from_target_files +++ b/tools/releasetools/ota_from_target_files @@ -500,6 +500,16 @@ def GetImage(which, tmpdir, info_dict): return sparse_img.SparseImage(path, mappath, clobbered_blocks) +def CopyInstallTools(output_zip): + oldcwd = os.getcwd() + os.chdir(os.getenv('OUT')) + for root, subdirs, files in os.walk("install"): + for f in files: + p = os.path.join(root, f) + output_zip.write(p, p) + os.chdir(oldcwd) + + 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 @@ -597,12 +607,12 @@ else if get_stage("%(bcb_dev)s") == "3/3" then script.AppendExtra("ifelse(is_mounted(\"/system\"), unmount(\"/system\"));") device_specific.FullOTA_InstallBegin() + CopyInstallTools(output_zip) + script.UnpackPackageDir("install", "/tmp/install") + script.SetPermissionsRecursive("/tmp/install", 0, 0, 0755, 0644, None, None) + script.SetPermissionsRecursive("/tmp/install/bin", 0, 0, 0755, 0755, None, None) + if OPTIONS.backuptool: - if block_based: - common.ZipWriteStr(output_zip, "system/bin/backuptool.sh", - ""+input_zip.read("SYSTEM/bin/backuptool.sh")) - common.ZipWriteStr(output_zip, "system/bin/backuptool.functions", - ""+input_zip.read("SYSTEM/bin/backuptool.functions")) script.Mount("/system") script.RunBackup("backup") script.Unmount("/system") @@ -614,10 +624,6 @@ else if get_stage("%(bcb_dev)s") == "3/3" then if HasVendorPartition(input_zip): system_progress -= 0.1 - if block_based: - common.ZipWriteStr(output_zip, "system/bin/otasigcheck.sh", - ""+input_zip.read("SYSTEM/bin/otasigcheck.sh")) - script.AppendExtra("if is_mounted(\"/data\") then") script.ValidateSignatures("data") script.AppendExtra("else") @@ -690,12 +696,6 @@ else if get_stage("%(bcb_dev)s") == "3/3" then common.CheckSize(boot_img.data, "boot.img", OPTIONS.info_dict) common.ZipWriteStr(output_zip, "boot.img", boot_img.data) - if block_based: - script.Mount("/system") - script.ValidateSignatures("cleanup") - if block_based: - script.Unmount("/system") - device_specific.FullOTA_PostValidate() if OPTIONS.backuptool: |