Merge changes from topic "dap_size_check" am: 3c4889fc79
am: 27128f4b10
Change-Id: I3bdebdef8a8bcef7c841967ff9562342ed33a60c
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