diff options
author | Tianjie <xunchang@google.com> | 2020-06-25 22:59:54 -0700 |
---|---|---|
committer | SzuWei Lin <szuweilin@google.com> | 2020-06-26 16:44:14 +0000 |
commit | 8c2d9096e38a9f4c5cc9e5c2b037111188328c3d (patch) | |
tree | 9241aaa41c930ddb32dd824aa09da349d0ab433d | |
parent | 30d5c93f4738d86a21393bb2195fab146e1d074a (diff) | |
download | build_make-8c2d9096e38a9f4c5cc9e5c2b037111188328c3d.tar.gz build_make-8c2d9096e38a9f4c5cc9e5c2b037111188328c3d.tar.bz2 build_make-8c2d9096e38a9f4c5cc9e5c2b037111188328c3d.zip |
Rename the boot image for avb validation
Starting from http://go/aog/1328118, we chained the 1st GKI
boot image into vbmeta. However, this fails avb validation;
because the avbtool constructs the image path based by using
"partition name + ext".
This cl works around the issue by renaming boot-5.4.img to
boot.img, so avbtool can find the image correctly.
Bug: 159656873
Test: run validate target file
Change-Id: I577226596e139e5b5f3e6ca3c28ced02431ca392
Merged-Id: I577226596e139e5b5f3e6ca3c28ced02431ca392
(cherry picked from commit 5ec1a7a66a5c66f0e4ba4999c5ac34f7022d246d)
-rwxr-xr-x | tools/releasetools/validate_target_files.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py index 69be5119ab..ac469eb685 100755 --- a/tools/releasetools/validate_target_files.py +++ b/tools/releasetools/validate_target_files.py @@ -371,6 +371,17 @@ def ValidateVerifiedBootImages(input_tmp, info_dict, options): partition, info_dict, key_file) cmd.extend(['--expected_chain_partition', chained_partition_arg]) + # Handle the boot image with a non-default name, e.g. boot-5.4.img + boot_images = info_dict.get("boot_images") + if boot_images: + # we used the 1st boot image to generate the vbmeta. Rename the filename + # to boot.img so that avbtool can find it correctly. + first_image_name = boot_images.split()[0] + first_image_path = os.path.join(input_tmp, 'IMAGES', first_image_name) + assert os.path.isfile(first_image_path) + renamed_boot_image_path = os.path.join(input_tmp, 'IMAGES', 'boot.img') + os.rename(first_image_path, renamed_boot_image_path) + proc = common.Run(cmd) stdoutdata, _ = proc.communicate() assert proc.returncode == 0, \ |