From 49fadf41ebb09282748ebdf4f209bc0a2523d268 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Tue, 7 Mar 2023 14:35:42 -0800 Subject: [PATCH 1/2] Fix secondary payload generation Secondary payload is already handled by creating a new instance of PayloadGenerator, when creating PayloadGenerator for primary payload, we should not include the OPTIONS.secondary parameter. Bug: 270100752 Test: ota_from_target_files --include_secondary Change-Id: I908043bad11aa6d47dc4dc9b61da460fcfa4f0b9 --- tools/releasetools/ota_from_target_files.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 97fbd510cb..88adffb46b 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -893,6 +893,7 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): (source_info is not None and not source_info.is_vabc_xor): logger.info("VABC XOR Not supported, disabling") OPTIONS.enable_vabc_xor = False + additional_args = [] # Prepare custom images. @@ -923,7 +924,7 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): # Metadata to comply with Android OTA package format. metadata = GetPackageMetadata(target_info, source_info) # Generate payload. - payload = PayloadGenerator(OPTIONS.include_secondary, OPTIONS.wipe_user_data) + payload = PayloadGenerator(wipe_user_data=OPTIONS.wipe_user_data) partition_timestamps_flags = [] # Enforce a max timestamp this payload can be applied on top of. From 88043be8c37e2013a5ef66c56d0fd6b425206191 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Tue, 7 Mar 2023 14:42:18 -0800 Subject: [PATCH 2/2] Disable VABC xor if COW isn't compressed XOR only saves space if COW data is compressed. If compression parameter is set to none, disable XOR as it does not save anything but still costs CPU cycles. Test: th Change-Id: I674ad74140570ce4740c290d1adb9e9b5a08426e --- tools/releasetools/ota_from_target_files.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 88adffb46b..81b992ec22 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -894,6 +894,9 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): logger.info("VABC XOR Not supported, disabling") OPTIONS.enable_vabc_xor = False + if OPTIONS.vabc_compression_param == "none": + logger.info("VABC Compression algorithm is set to 'none', disabling VABC xor") + OPTIONS.enable_vabc_xor = False additional_args = [] # Prepare custom images.