releasetools: Stop copying images from RADIO/ to IMAGES/.
We've added support in brillo_update_payload that allows additionally
looking for images under RADIO/ in the given target_files zips [1]. This
avoids having duplicate radio images in target_files zips.
Also adjust the unittest in test_ota_from_target_files.py to cover this
path.
As a result of this CL, the radio images will no longer appear in the
image archive (i.e. <target>-img.zip) as well - they are less useful
anyway because we have packed only the _updatable_ pieces that are part
of full bootloader/radio images.
Bug: 77218220
Test: `python -m unittest test_ota_from_target_files`
Test: `python -m unittest test_add_img_to_target_files`
Test: `m dist` produces the same full OTA package
Test: Build marlin-userdebug in internal branch. Check the image zip.
Change-Id: I05579480f0bb9ab90aaeecf75969ee29b6904ad6
diff --git a/tools/releasetools/test_ota_from_target_files.py b/tools/releasetools/test_ota_from_target_files.py
index d7cace8..0eb24b5 100644
--- a/tools/releasetools/test_ota_from_target_files.py
+++ b/tools/releasetools/test_ota_from_target_files.py
@@ -50,17 +50,25 @@
"POSTINSTALL_OPTIONAL_system=true",
]))
+ ab_partitions = [
+ ('IMAGES', 'boot'),
+ ('IMAGES', 'system'),
+ ('IMAGES', 'vendor'),
+ ('RADIO', 'bootloader'),
+ ('RADIO', 'modem'),
+ ]
# META/ab_partitions.txt
- ab_partitions = ['boot', 'system', 'vendor']
target_files_zip.writestr(
'META/ab_partitions.txt',
- '\n'.join(ab_partitions))
+ '\n'.join([partition[1] for partition in ab_partitions]))
# Create dummy images for each of them.
- for partition in ab_partitions:
- target_files_zip.writestr('IMAGES/' + partition + '.img',
- os.urandom(len(partition)))
+ for path, partition in ab_partitions:
+ target_files_zip.writestr(
+ '{}/{}.img'.format(path, partition),
+ os.urandom(len(partition)))
+ # system_other shouldn't appear in META/ab_partitions.txt.
if secondary:
target_files_zip.writestr('IMAGES/system_other.img',
os.urandom(len("system_other")))