forked from openkylin/platform_build
build_image: remove an unnecessary call to append2simg
append2simg on a large image is fairly slow, so append verity metadata to the hash tree to avoid two calls. Bug: 26251929 Change-Id: I5ec84dcd6e8500e990af13b1f9cef5e809b41605
This commit is contained in:
parent
d49e55561a
commit
ff914f5dd0
|
@ -182,14 +182,23 @@ def Append2Simg(sparse_image_path, unsparse_image_path, error_message):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def Append(target, file_to_append, error_message):
|
||||||
|
cmd = 'cat %s >> %s' % (file_to_append, target)
|
||||||
|
print cmd
|
||||||
|
status, output = commands.getstatusoutput(cmd)
|
||||||
|
if status:
|
||||||
|
print "%s: %s" % (error_message, output)
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def BuildVerifiedImage(data_image_path, verity_image_path,
|
def BuildVerifiedImage(data_image_path, verity_image_path,
|
||||||
verity_metadata_path):
|
verity_metadata_path):
|
||||||
if not Append2Simg(data_image_path, verity_image_path,
|
if not Append(verity_image_path, verity_metadata_path,
|
||||||
"Could not append verity tree!"):
|
|
||||||
return False
|
|
||||||
if not Append2Simg(data_image_path, verity_metadata_path,
|
|
||||||
"Could not append verity metadata!"):
|
"Could not append verity metadata!"):
|
||||||
return False
|
return False
|
||||||
|
if not Append2Simg(data_image_path, verity_image_path,
|
||||||
|
"Could not append verity data!"):
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def UnsparseImage(sparse_image_path, replace=True):
|
def UnsparseImage(sparse_image_path, replace=True):
|
||||||
|
|
Loading…
Reference in New Issue