Restrict the verification in block-based incremental OTAs
BlockImageDiff has three versions. Only the incremental OTAs generated
with the latest version (3) can be re-applied to the system that's
already on the target build. Otherwise, operations like move will make
unconditional changes and damage the system. During the verification
phase, abort the OTA update if BlockImageDiff is less than 3 and it
doesn't match the checksum of the source build.
Change-Id: Iaf834a2d99dfea0bb423a4a2aa09e8906424482d
(cherry picked from commit daebaa6ed3
)
This commit is contained in:
@@ -1024,17 +1024,19 @@ def ComputeDifferences(diffs):
|
||||
|
||||
|
||||
class BlockDifference:
|
||||
def __init__(self, partition, tgt, src=None, check_first_block=False):
|
||||
def __init__(self, partition, tgt, src=None, check_first_block=False, version=None):
|
||||
self.tgt = tgt
|
||||
self.src = src
|
||||
self.partition = partition
|
||||
self.check_first_block = check_first_block
|
||||
|
||||
self.version = 1
|
||||
if OPTIONS.info_dict:
|
||||
self.version = max(
|
||||
int(i) for i in
|
||||
OPTIONS.info_dict.get("blockimgdiff_versions", "1").split(","))
|
||||
if version is None:
|
||||
version = 1
|
||||
if OPTIONS.info_dict:
|
||||
version = max(
|
||||
int(i) for i in
|
||||
OPTIONS.info_dict.get("blockimgdiff_versions", "1").split(","))
|
||||
self.version = version
|
||||
|
||||
b = blockimgdiff.BlockImageDiff(tgt, src, threads=OPTIONS.worker_threads,
|
||||
version=self.version)
|
||||
|
Reference in New Issue
Block a user