resolved conflicts for merge of 22311914 to master

Change-Id: I8684191fa3efea0ed546bbad076f8760a13c5c81
This commit is contained in:
Tao Bao
2015-03-14 00:26:06 -07:00

View File

@@ -1069,17 +1069,25 @@ class BlockDifference:
script.AppendExtra('if range_sha1("%s", "%s") == "%s" then' % script.AppendExtra('if range_sha1("%s", "%s") == "%s" then' %
(self.device, self.src.care_map.to_string_raw(), (self.device, self.src.care_map.to_string_raw(),
self.src.TotalSha1())) self.src.TotalSha1()))
script.Print("Verified %s image..." % (partition,)) script.Print('Verified %s image...' % (partition,))
script.AppendExtra('else'); script.AppendExtra('else');
# When generating incrementals for the system and vendor partitions,
# explicitly check the first block (which contains the superblock) of
# the partition to see if it's what we expect. If this check fails,
# give an explicit log message about the partition having been
# remounted R/W (the most likely explanation) and the need to flash to
# get OTAs working again.
if self.check_first_block: if self.check_first_block:
self._CheckFirstBlock(script) self._CheckFirstBlock(script)
script.AppendExtra(('(range_sha1("%s", "%s") == "%s") ||\n' # Abort the OTA update. Note that the incremental OTA cannot be applied
' abort("%s partition has unexpected contents");\n' # even if it may match the checksum of the target partition.
'endif;') % # a) If version < 3, operations like move and erase will make changes
(self.device, self.tgt.care_map.to_string_raw(), # unconditionally and damage the partition.
self.tgt.TotalSha1(), self.partition)) # b) If version >= 3, it won't even reach here.
script.AppendExtra(('abort("%s partition has unexpected contents");\n'
'endif;') % (partition,))
def _WriteUpdate(self, script, output_zip): def _WriteUpdate(self, script, output_zip):
partition = self.partition partition = self.partition
@@ -1109,14 +1117,11 @@ class BlockDifference:
def _CheckFirstBlock(self, script): def _CheckFirstBlock(self, script):
r = RangeSet((0, 1)) r = RangeSet((0, 1))
srchash = self._HashBlocks(self.src, r); srchash = self._HashBlocks(self.src, r);
tgthash = self._HashBlocks(self.tgt, r);
script.AppendExtra(('(range_sha1("%s", "%s") == "%s") || ' script.AppendExtra(('(range_sha1("%s", "%s") == "%s") || '
'(range_sha1("%s", "%s") == "%s") || '
'abort("%s has been remounted R/W; ' 'abort("%s has been remounted R/W; '
'reflash device to reenable OTA updates");') 'reflash device to reenable OTA updates");')
% (self.device, r.to_string_raw(), srchash, % (self.device, r.to_string_raw(), srchash,
self.device, r.to_string_raw(), tgthash,
self.device)) self.device))
DataImage = blockimgdiff.DataImage DataImage = blockimgdiff.DataImage