Merge "Add a compressor types option"

This commit is contained in:
Treehugger Robot 2021-11-04 04:13:13 +00:00 committed by Gerrit Code Review
commit 1e392720c2

View file

@ -227,6 +227,9 @@ A/B OTA specific options
--force_minor_version
Override the update_engine minor version for delta generation.
--compressor_types
A colon ':' separated list of compressors. Allowed values are bz2 and brotli.
"""
from __future__ import print_function
@ -294,6 +297,7 @@ OPTIONS.spl_downgrade = False
OPTIONS.vabc_downgrade = False
OPTIONS.enable_vabc_xor = True
OPTIONS.force_minor_version = None
OPTIONS.compressor_types = None
POSTINSTALL_CONFIG = 'META/postinstall_config.txt'
DYNAMIC_PARTITION_INFO = 'META/dynamic_partitions_info.txt'
@ -1149,6 +1153,8 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None):
additional_args += ["--enable_vabc_xor", "true"]
if OPTIONS.force_minor_version:
additional_args += ["--force_minor_version", OPTIONS.force_minor_version]
if OPTIONS.compressor_types:
additional_args += ["--compressor_types", OPTIONS.compressor_types]
additional_args += ["--max_timestamp", max_timestamp]
if SupportsMainlineGkiUpdates(source_file):
@ -1324,6 +1330,8 @@ def main(argv):
OPTIONS.enable_vabc_xor = a.lower() != "false"
elif o == "--force_minor_version":
OPTIONS.force_minor_version = a
elif o == "--compressor_types":
OPTIONS.compressor_types = a
else:
return False
return True
@ -1370,6 +1378,7 @@ def main(argv):
"vabc_downgrade",
"enable_vabc_xor=",
"force_minor_version=",
"compressor_types=",
], extra_option_handler=option_handler)
if len(args) != 2: