diff options
author | Dan Albert <danalbert@google.com> | 2015-01-27 15:53:15 -0800 |
---|---|---|
committer | Tao Bao <tbao@google.com> | 2015-03-19 13:59:01 -0700 |
commit | 8e0178d41b9eeb6754eda07292d78762e3169140 (patch) | |
tree | 9734e89c52feb3931e357f58ae1191a23e52c21d /tools/releasetools/ota_from_target_files | |
parent | 9682e56a794f2fc68cae00475b7f11927c57b3da (diff) | |
download | build-8e0178d41b9eeb6754eda07292d78762e3169140.zip build-8e0178d41b9eeb6754eda07292d78762e3169140.tar.gz build-8e0178d41b9eeb6754eda07292d78762e3169140.tar.bz2 |
Allow system images larger than 2GiB.
Python 2.7's zipfile implementation wrongly thinks that zip64 is
required for files larger than 2GiB. We can work around this by
adjusting their limit. Note that `zipfile.writestr()` will not work
for strings larger than 2GiB. The Python interpreter sometimes rejects
strings that large (though it isn't clear to me exactly what
circumstances cause this). `zipfile.write()` must be used directly to
work around this.
This mess can be avoided if we port to python3.
The bug (b/19364241) in original commit has been fixed.
Bug: 18015246
Bug: 19364241
Bug: 19839468
(cherry picked from commit cd082d4bfe917b2e6b97436839cbbbc67c733c83)
Change-Id: I7b5cc310e0a9ba894533b53cb998afd5ce96d8c6
Diffstat (limited to 'tools/releasetools/ota_from_target_files')
-rwxr-xr-x | tools/releasetools/ota_from_target_files | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files index 25309a4..6e0fefc 100755 --- a/tools/releasetools/ota_from_target_files +++ b/tools/releasetools/ota_from_target_files @@ -646,10 +646,8 @@ endif; WriteMetadata(metadata, output_zip) -def WritePolicyConfig(file_context, output_zip): - f = open(file_context, 'r'); - basename = os.path.basename(file_context) - common.ZipWriteStr(output_zip, basename, f.read()) +def WritePolicyConfig(file_name, output_zip): + common.ZipWrite(output_zip, file_name, os.path.basename(file_name)) def WriteMetadata(metadata, output_zip): |