Merge "Don't build super image if source images are missing" am: f37236df5f
am: 40b9882e71
Change-Id: I6baa7f1cea1c892aeb3af48bbf059c0e24241cb7
This commit is contained in:
@@ -657,12 +657,13 @@ def AddSuperSplit(output_zip):
|
|||||||
"""Create split super_*.img and store it in output_zip."""
|
"""Create split super_*.img and store it in output_zip."""
|
||||||
|
|
||||||
outdir = os.path.join(OPTIONS.input_tmp, "OTA")
|
outdir = os.path.join(OPTIONS.input_tmp, "OTA")
|
||||||
build_super_image.BuildSuperImage(OPTIONS.input_tmp, outdir)
|
built = build_super_image.BuildSuperImage(OPTIONS.input_tmp, outdir)
|
||||||
|
|
||||||
for dev in OPTIONS.info_dict['super_block_devices'].strip().split():
|
if built:
|
||||||
img = OutputFile(output_zip, OPTIONS.input_tmp, "OTA",
|
for dev in OPTIONS.info_dict['super_block_devices'].strip().split():
|
||||||
"super_" + dev + ".img")
|
img = OutputFile(output_zip, OPTIONS.input_tmp, "OTA",
|
||||||
img.Write()
|
"super_" + dev + ".img")
|
||||||
|
img.Write()
|
||||||
|
|
||||||
|
|
||||||
def ReplaceUpdatedFiles(zip_filename, files_list):
|
def ReplaceUpdatedFiles(zip_filename, files_list):
|
||||||
|
@@ -138,14 +138,25 @@ def BuildSuperImageFromDict(info_dict, output):
|
|||||||
else:
|
else:
|
||||||
logger.info("Done writing image %s", output)
|
logger.info("Done writing image %s", output)
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def BuildSuperImageFromExtractedTargetFiles(inp, out):
|
def BuildSuperImageFromExtractedTargetFiles(inp, out):
|
||||||
info_dict = common.LoadInfoDict(inp)
|
info_dict = common.LoadInfoDict(inp)
|
||||||
partition_list = shlex.split(
|
partition_list = shlex.split(
|
||||||
info_dict.get("dynamic_partition_list", "").strip())
|
info_dict.get("dynamic_partition_list", "").strip())
|
||||||
|
missing_images = []
|
||||||
for partition in partition_list:
|
for partition in partition_list:
|
||||||
info_dict["{}_image".format(partition)] = os.path.join(
|
image_path = os.path.join(inp, "IMAGES", "{}.img".format(partition))
|
||||||
inp, "IMAGES", "{}.img".format(partition))
|
if not os.path.isfile(image_path):
|
||||||
|
missing_images.append(image_path)
|
||||||
|
else:
|
||||||
|
info_dict["{}_image".format(partition)] = image_path
|
||||||
|
if missing_images:
|
||||||
|
logger.warning("Skip building super image because the following "
|
||||||
|
"images are missing from target files:\n%s",
|
||||||
|
"\n".join(missing_images))
|
||||||
|
return False
|
||||||
return BuildSuperImageFromDict(info_dict, out)
|
return BuildSuperImageFromDict(info_dict, out)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user