Merge "Fix non-AB ota generation failure" into main
This commit is contained in:
@@ -16,6 +16,15 @@ import re
|
|||||||
|
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
# map recovery.fstab's fs_types to mount/format "partition types"
|
||||||
|
PARTITION_TYPES = {
|
||||||
|
"ext4": "EMMC",
|
||||||
|
"emmc": "EMMC",
|
||||||
|
"f2fs": "EMMC",
|
||||||
|
"squashfs": "EMMC",
|
||||||
|
"erofs": "EMMC"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class ErrorCode(object):
|
class ErrorCode(object):
|
||||||
"""Define error_codes for failures that happen during the actual
|
"""Define error_codes for failures that happen during the actual
|
||||||
@@ -268,7 +277,7 @@ class EdifyGenerator(object):
|
|||||||
if p.context is not None:
|
if p.context is not None:
|
||||||
mount_flags = p.context + ("," + mount_flags if mount_flags else "")
|
mount_flags = p.context + ("," + mount_flags if mount_flags else "")
|
||||||
self.script.append('mount("%s", "%s", %s, "%s", "%s");' % (
|
self.script.append('mount("%s", "%s", %s, "%s", "%s");' % (
|
||||||
p.fs_type, common.PARTITION_TYPES[p.fs_type],
|
p.fs_type, PARTITION_TYPES[p.fs_type],
|
||||||
self._GetSlotSuffixDeviceForEntry(p),
|
self._GetSlotSuffixDeviceForEntry(p),
|
||||||
p.mount_point, mount_flags))
|
p.mount_point, mount_flags))
|
||||||
self.mounts.add(p.mount_point)
|
self.mounts.add(p.mount_point)
|
||||||
@@ -304,7 +313,7 @@ class EdifyGenerator(object):
|
|||||||
if fstab:
|
if fstab:
|
||||||
p = fstab[partition]
|
p = fstab[partition]
|
||||||
self.script.append('format("%s", "%s", %s, "%s", "%s");' %
|
self.script.append('format("%s", "%s", %s, "%s", "%s");' %
|
||||||
(p.fs_type, common.PARTITION_TYPES[p.fs_type],
|
(p.fs_type, PARTITION_TYPES[p.fs_type],
|
||||||
self._GetSlotSuffixDeviceForEntry(p),
|
self._GetSlotSuffixDeviceForEntry(p),
|
||||||
p.length, p.mount_point))
|
p.length, p.mount_point))
|
||||||
|
|
||||||
@@ -418,7 +427,7 @@ class EdifyGenerator(object):
|
|||||||
fstab = self.fstab
|
fstab = self.fstab
|
||||||
if fstab:
|
if fstab:
|
||||||
p = fstab[mount_point]
|
p = fstab[mount_point]
|
||||||
partition_type = common.PARTITION_TYPES[p.fs_type]
|
partition_type = PARTITION_TYPES[p.fs_type]
|
||||||
device = self._GetSlotSuffixDeviceForEntry(p)
|
device = self._GetSlotSuffixDeviceForEntry(p)
|
||||||
args = {'device': device, 'fn': fn}
|
args = {'device': device, 'fn': fn}
|
||||||
if partition_type == "EMMC":
|
if partition_type == "EMMC":
|
||||||
|
@@ -26,7 +26,7 @@ import shlex
|
|||||||
|
|
||||||
import common
|
import common
|
||||||
import edify_generator
|
import edify_generator
|
||||||
from edify_generator import ErrorCode
|
from edify_generator import ErrorCode, PARTITION_TYPES
|
||||||
from check_target_files_vintf import CheckVintfIfTrebleEnabled, HasPartition
|
from check_target_files_vintf import CheckVintfIfTrebleEnabled, HasPartition
|
||||||
from common import OPTIONS, Run, MakeTempDir, RunAndCheckOutput, ZipWrite, MakeTempFile
|
from common import OPTIONS, Run, MakeTempDir, RunAndCheckOutput, ZipWrite, MakeTempFile
|
||||||
from ota_utils import UNZIP_PATTERN, FinalizeMetadata, GetPackageMetadata, PropertyFiles
|
from ota_utils import UNZIP_PATTERN, FinalizeMetadata, GetPackageMetadata, PropertyFiles
|
||||||
@@ -60,9 +60,9 @@ def GetBlockDifferences(target_zip, source_zip, target_info, source_info,
|
|||||||
# Disable imgdiff because it relies on zlib to produce stable output
|
# Disable imgdiff because it relies on zlib to produce stable output
|
||||||
# across different versions, which is often not the case.
|
# across different versions, which is often not the case.
|
||||||
return BlockDifference(name, partition_tgt, partition_src,
|
return BlockDifference(name, partition_tgt, partition_src,
|
||||||
check_first_block,
|
check_first_block,
|
||||||
version=blockimgdiff_version,
|
version=blockimgdiff_version,
|
||||||
disable_imgdiff=True)
|
disable_imgdiff=True)
|
||||||
|
|
||||||
if source_zip:
|
if source_zip:
|
||||||
# See notes in common.GetUserImage()
|
# See notes in common.GetUserImage()
|
||||||
@@ -85,7 +85,7 @@ def GetBlockDifferences(target_zip, source_zip, target_info, source_info,
|
|||||||
info_dict=target_info,
|
info_dict=target_info,
|
||||||
reset_file_map=True)
|
reset_file_map=True)
|
||||||
block_diff_dict[partition] = BlockDifference(partition, tgt,
|
block_diff_dict[partition] = BlockDifference(partition, tgt,
|
||||||
src=None)
|
src=None)
|
||||||
# Incremental OTA update.
|
# Incremental OTA update.
|
||||||
else:
|
else:
|
||||||
block_diff_dict[partition] = GetIncrementalBlockDifferenceForPartition(
|
block_diff_dict[partition] = GetIncrementalBlockDifferenceForPartition(
|
||||||
@@ -413,7 +413,7 @@ else if get_stage("%(bcb_dev)s") != "3/3" then
|
|||||||
block_diff_dict.values()]
|
block_diff_dict.values()]
|
||||||
if updating_boot:
|
if updating_boot:
|
||||||
boot_type, boot_device_expr = GetTypeAndDeviceExpr("/boot",
|
boot_type, boot_device_expr = GetTypeAndDeviceExpr("/boot",
|
||||||
source_info)
|
source_info)
|
||||||
d = Difference(target_boot, source_boot, "bsdiff")
|
d = Difference(target_boot, source_boot, "bsdiff")
|
||||||
_, _, d = d.ComputePatch()
|
_, _, d = d.ComputePatch()
|
||||||
if d is None:
|
if d is None:
|
||||||
@@ -1544,16 +1544,6 @@ class DynamicPartitionsDifference(object):
|
|||||||
append('move %s %s' % (p, u.tgt_group))
|
append('move %s %s' % (p, u.tgt_group))
|
||||||
|
|
||||||
|
|
||||||
# map recovery.fstab's fs_types to mount/format "partition types"
|
|
||||||
PARTITION_TYPES = {
|
|
||||||
"ext4": "EMMC",
|
|
||||||
"emmc": "EMMC",
|
|
||||||
"f2fs": "EMMC",
|
|
||||||
"squashfs": "EMMC",
|
|
||||||
"erofs": "EMMC"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def GetTypeAndDevice(mount_point, info, check_no_slot=True):
|
def GetTypeAndDevice(mount_point, info, check_no_slot=True):
|
||||||
"""
|
"""
|
||||||
Use GetTypeAndDeviceExpr whenever possible. This function is kept for
|
Use GetTypeAndDeviceExpr whenever possible. This function is kept for
|
||||||
|
Reference in New Issue
Block a user