Merge "build_image: remove an unnecessary call to append2simg"
am: 06b4ff6696
* commit '06b4ff6696dfc11fafde52e17c6e9d46f0ec1be5':
build_image: remove an unnecessary call to append2simg
This commit is contained in:
commit
c734083df3
1 changed files with 13 additions and 4 deletions
|
@ -182,13 +182,22 @@ def Append2Simg(sparse_image_path, unsparse_image_path, error_message):
|
|||
return False
|
||||
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,
|
||||
verity_metadata_path):
|
||||
if not Append2Simg(data_image_path, verity_image_path,
|
||||
"Could not append verity tree!"):
|
||||
if not Append(verity_image_path, verity_metadata_path,
|
||||
"Could not append verity metadata!"):
|
||||
return False
|
||||
if not Append2Simg(data_image_path, verity_metadata_path,
|
||||
"Could not append verity metadata!"):
|
||||
if not Append2Simg(data_image_path, verity_image_path,
|
||||
"Could not append verity data!"):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in a new issue