diff options
author | Dan Albert <danalbert@google.com> | 2015-01-27 15:53:15 -0800 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-02-06 13:24:06 -0800 |
commit | cd082d4bfe917b2e6b97436839cbbbc67c733c83 (patch) | |
tree | 5fee2b245cb4c1b64179815e1309418ff07d7a0e /tools/releasetools/ota_from_target_files | |
parent | 7245b4e2bed6cef8c6bf4cc67ffd98989fde3c91 (diff) | |
download | build-cd082d4bfe917b2e6b97436839cbbbc67c733c83.zip build-cd082d4bfe917b2e6b97436839cbbbc67c733c83.tar.gz build-cd082d4bfe917b2e6b97436839cbbbc67c733c83.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.
Bug: 18015246
Change-Id: I8a476d99c5efdef6ea408373b706e9fbd3a798be
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 945f11a..6517bf3 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): |