Check block0 for remounting partition R/W
Add a function check_first_block to read block0 and output a message
on screen if the device has been remounted. The function is called
for version >= 4 only; it executes after a failing block verification
and before recovery attempts.
Bug: 21124327
Change-Id: I49dc0b861c702698896a2495ca094215705d4650
(cherry picked from commit 9dac797013
)
This commit is contained in:
@@ -811,7 +811,12 @@ 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"
|
||||
system_diff = common.BlockDifference("system", system_tgt, system_src,
|
||||
check_first_block,
|
||||
version=blockimgdiff_version)
|
||||
|
||||
if HasVendorPartition(target_zip):
|
||||
@@ -821,7 +826,13 @@ def WriteBlockIncrementalOTAPackage(target_zip, source_zip, output_zip):
|
||||
OPTIONS.source_info_dict)
|
||||
vendor_tgt = GetImage("vendor", OPTIONS.target_tmp,
|
||||
OPTIONS.target_info_dict)
|
||||
|
||||
# Check first block of vendor partition for remount R/W only if
|
||||
# disk type is ext4
|
||||
vendor_partition = OPTIONS.source_info_dict["fstab"]["/vendor"]
|
||||
check_first_block = vendor_partition.fs_type=="ext4"
|
||||
vendor_diff = common.BlockDifference("vendor", vendor_tgt, vendor_src,
|
||||
check_first_block,
|
||||
version=blockimgdiff_version)
|
||||
else:
|
||||
vendor_diff = None
|
||||
|
Reference in New Issue
Block a user