summaryrefslogtreecommitdiffstats
path: root/tools/releasetools/ota_from_target_files.py
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-05-12 11:42:31 -0700
committerTao Bao <tbao@google.com>2015-05-13 12:26:04 -0700
commit5ece99d64efe82fc1ca97a96f079ce69ea588a24 (patch)
tree55b6713bc22d1a1695fd41a111680f75d7a65e98 /tools/releasetools/ota_from_target_files.py
parentc0ba40b8a17669b9938008f826cef88aa791c828 (diff)
downloadbuild-5ece99d64efe82fc1ca97a96f079ce69ea588a24.zip
build-5ece99d64efe82fc1ca97a96f079ce69ea588a24.tar.gz
build-5ece99d64efe82fc1ca97a96f079ce69ea588a24.tar.bz2
Add support for clobbered blocks
In ext4 filesystems, some blocks might be changed even being mounted R/O, such as the superblock (block 0). We need to exclude such blocks from integrity verification. Plus such blocks should always be written to the target by copying instead of patching. Bug: http://b/20939131 Change-Id: I657025b7b1ad50d4365e7b18dc39308facfe864e (cherry picked from commit ff7778166bd13a90c89fa333591ee2037f587a11)
Diffstat (limited to 'tools/releasetools/ota_from_target_files.py')
-rwxr-xr-xtools/releasetools/ota_from_target_files.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 900eaec..c4d0c1b 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -475,7 +475,13 @@ def GetImage(which, tmpdir, info_dict):
path = add_img_to_target_files.BuildVendor(
tmpdir, info_dict, block_list=mappath)
- return sparse_img.SparseImage(path, mappath)
+ # Bug: http://b/20939131
+ # In ext4 filesystems, block 0 might be changed even being mounted
+ # R/O. We add it to clobbered_blocks so that it will be written to the
+ # target unconditionally. Note that they are still part of care_map.
+ clobbered_blocks = "0"
+
+ return sparse_img.SparseImage(path, mappath, clobbered_blocks)
def WriteFullOTAPackage(input_zip, output_zip):
@@ -773,7 +779,6 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip):
OPTIONS.info_dict.get("blockimgdiff_versions", "1").split(","))
system_diff = common.BlockDifference("system", system_tgt, system_src,
- check_first_block=True,
version=blockimgdiff_version)
if HasVendorPartition(target_zip):
@@ -784,7 +789,6 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip):
vendor_tgt = GetImage("vendor", OPTIONS.target_tmp,
OPTIONS.target_info_dict)
vendor_diff = common.BlockDifference("vendor", vendor_tgt, vendor_src,
- check_first_block=True,
version=blockimgdiff_version)
else:
vendor_diff = None