diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/releasetools/edify_generator.py | 6 | ||||
-rwxr-xr-x | tools/releasetools/validate_target_files.py | 11 |
2 files changed, 14 insertions, 3 deletions
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py index 99e21f1c04..b9c9b197b3 100644 --- a/tools/releasetools/edify_generator.py +++ b/tools/releasetools/edify_generator.py @@ -374,12 +374,12 @@ class EdifyGenerator(object): def _CheckSecondTokenNotSlotSuffixed(self, s, fn): lst = s.split(':') - assert(len(s) == 4), "{} does not contain 4 tokens".format(s) + assert(len(lst) == 4), "{} does not contain 4 tokens".format(s) if self.fstab: - entry = common.GetEntryForDevice(s[1]) + entry = common.GetEntryForDevice(self.fstab, lst[1]) if entry is not None: assert not entry.slotselect, \ - "Use %s because %s is slot suffixed" % (fn, s[1]) + "Use %s because %s is slot suffixed" % (fn, lst[1]) def WriteRawImage(self, mount_point, fn, mapfn=None): """Write the given package file into the partition for the given 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, \ |