diff options
author | Daniel Zheng <zhengdaniel@google.com> | 2024-03-06 09:58:20 -0800 |
---|---|---|
committer | Daniel Zheng <zhengdaniel@google.com> | 2024-03-21 10:47:51 -0700 |
commit | f3d476ed40d909e87e8070d62a2f04ddfde550bb (patch) | |
tree | 9464aa1438d0669ce259ac4de0fee21e5ee5ba28 | |
parent | 31a9fee831315547b4807763e6f1627fdee69bd7 (diff) | |
download | build-f3d476ed40d909e87e8070d62a2f04ddfde550bb.tar.gz |
allow command line override
Allow override for vabc_cow version if specified from the command line.
If OPTIONS.vabc_cow_version is already defined, then we don't want to
modify this value since it was defined by --vabc_compression_param=
Test: th
Change-Id: I57b8129faf5caf9de1dc8ad96e7570214a9f3313
-rwxr-xr-x | tools/releasetools/ota_from_target_files.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index c0ff5d2741..0b90b66cf0 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -912,12 +912,13 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): # and install time performance. All OTA's with # both the source build and target build with VIRTUAL_AB_COW_VERSION = 3 # can support the new format. Otherwise, fallback on older versions - if not source_info.vabc_cow_version or not target_info.vabc_cow_version: - logger.info("Source or Target doesn't have VABC_COW_VERSION specified, default to version 2") - OPTIONS.vabc_cow_version = 2 - elif source_info.vabc_cow_version != target_info.vabc_cow_version: - logger.info("Source and Target have different cow VABC_COW_VERSION specified, default to minimum version") - OPTIONS.vabc_cow_version = min(source_info.vabc_cow_version, target_info.vabc_cow_version) + if not OPTIONS.vabc_cow_version: + if not source_info.vabc_cow_version or not target_info.vabc_cow_version: + OPTIONS.vabc_cow_version = 2 + elif source_info.vabc_cow_version != target_info.vabc_cow_version: + OPTIONS.vabc_cow_version = min(source_info.vabc_cow_version, target_info.vabc_cow_version) + if OPTIONS.vabc_cow_version: + logger.info("Source or Target doesn't have VABC_COW_VERSION specified, using version: " + OPTIONS.vabc_cow_version) # Virtual AB Compression was introduced in Androd S. # Later, we backported VABC to Android R. But verity support was not # backported, so if VABC is used and we are on Android R, disable |