From f8acad1480a3b4479c7ddfa89df8be946d83d3ed Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Thu, 7 Jul 2016 09:09:58 -0700 Subject: [PATCH] releasetools: Fix the detection of using squashfs. We should disable using imgdiff if *any* of the source and target partitions uses squashfs. Bug: 30004734 Test: Create an incremental with two builds with one of them uses squashfs. Change-Id: I826cd13d7b852c548e4b45e61f5ae00f6407cac3 --- tools/releasetools/ota_from_target_files.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 915a29ed31..b29ba695b6 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -873,15 +873,17 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip): int(i) for i in OPTIONS.info_dict.get("blockimgdiff_versions", "1").split(",")) - # Check first block of system partition for remount R/W only if - # disk type is ext4 - system_partition = OPTIONS.source_info_dict["fstab"]["/system"] - check_first_block = system_partition.fs_type == "ext4" + # Check the first block of the source system partition for remount R/W only + # if the filesystem is ext4. + system_src_partition = OPTIONS.source_info_dict["fstab"]["/system"] + check_first_block = system_src_partition.fs_type == "ext4" # Disable using imgdiff for squashfs. 'imgdiff -z' expects input files to be # in zip formats. However with squashfs, a) all files are compressed in LZ4; # b) the blocks listed in block map may not contain all the bytes for a given # file (because they're rounded to be 4K-aligned). - disable_imgdiff = system_partition.fs_type == "squashfs" + system_tgt_partition = OPTIONS.target_info_dict["fstab"]["/system"] + disable_imgdiff = (system_src_partition.fs_type == "squashfs" or + system_tgt_partition.fs_type == "squashfs") system_diff = common.BlockDifference("system", system_tgt, system_src, check_first_block, version=blockimgdiff_version,