releasetools: Detect incomplete block ranges.
This CL detects incomplete block ranges (e.g. due to the holes in mke2fs created images). Such block ranges will be tagged, so we won't attempt to imgdiff those files. Note that the change to blockimgdiff.py, which uses the tag info, will come in a separate CL. An 'extra' attribute is added to RangeSet class, which defaults to an empty dict. An 'incomplete' tag will be added into the dict by the caller of the class. Not adding this tag as an immediate attribute, because it is not a property regarding the ranges being represented, but rather some storage space for the caller. This CL also refactors GetSparseImage and RoundUpTo4K into common.py, so the same code can be called from both of ota_from_target_files.py and validate_target_files.py. Not able to add unittests for GetSparseImage(), as SparseImage requires data in specific format. Bug: 68016761 Test: Run validate_target_files.py on target-files.zip. It skips validating files with missing holes as before. Test: Run ota_from_target_files.py on angler target-files.zip. It gives identical packages w/ and w/o the CL. Test: pylint on changed files. There're warnings with common.py, but unrelated to this change. Change-Id: I126ccfea13c0d5ebcc8c1b4ff1a4f9200e97423a
Loading
Please register or sign in to comment