Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74dfbb85 authored by Tao Bao's avatar Tao Bao
Browse files

releasetools: Skip checking files with non-monotonic ranges.

Bug: 79951743
Test: Run validate_target_files.py on target_files.zip that has
      non-monotonic ranges listed in IMAGES/system.map.
Change-Id: I28d3ca6972d361362589cd51e60731af9994a551
Merged-In: I28d3ca6972d361362589cd51e60731af9994a551
(cherry picked from commit d32936d6)
parent d653d7a0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -87,6 +87,13 @@ def ValidateFileConsistency(input_zip, input_tmp):
      # Read the blocks that the file resides. Note that it will contain the
      # bytes past the file length, which is expected to be padded with '\0's.
      ranges = image.file_map[entry]

      # TODO(b/79951650): Handle files with non-monotonic ranges.
      if not ranges.monotonic:
        logging.warning(
            'Skipping %s that has non-monotonic ranges: %s', entry, ranges)
        continue

      blocks_sha1 = image.RangeSha1(ranges)

      # The filename under unpacked directory, such as SYSTEM/bin/sh.