Merge changes from topic "dap_size_check"
* changes: Only assert-max-image-size for static partitions. sparse_img.py --get_partition_size return size of partition Revert "Fix dynamic partition size check for devices with recovery"
This commit is contained in:
@@ -58,16 +58,8 @@ logger = logging.getLogger(__name__)
|
||||
UNZIP_PATTERN = ["IMAGES/*", "META/*"]
|
||||
|
||||
|
||||
def GetPartitionSizeFromImage(img):
|
||||
try:
|
||||
simg = sparse_img.SparseImage(img)
|
||||
return simg.blocksize * simg.total_blocks
|
||||
except ValueError:
|
||||
return os.path.getsize(img)
|
||||
|
||||
|
||||
def GetArgumentsForImage(partition, group, image=None):
|
||||
image_size = GetPartitionSizeFromImage(image) if image else 0
|
||||
image_size = sparse_img.GetImagePartitionSize(image) if image else 0
|
||||
|
||||
cmd = ["--partition",
|
||||
"{}:readonly:{}:{}".format(partition, image_size, group)]
|
||||
|
Reference in New Issue
Block a user