diff options
Diffstat (limited to 'tools/binman/control.py')
-rw-r--r-- | tools/binman/control.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py index dcf070da85..4b3ce23fb4 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -500,7 +500,8 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded): def ProcessImage(image, update_fdt, write_map, get_contents=True, - allow_resize=True, allow_missing=False): + allow_resize=True, allow_missing=False, + allow_fake_blobs=False): """Perform all steps for this image, including checking and # writing it. This means that errors found with a later image will be reported after @@ -516,12 +517,15 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True, allow_resize: True to allow entries to change size (this does a re-pack of the entries), False to raise an exception allow_missing: Allow blob_ext objects to be missing + allow_fake_blobs: Allow blob_ext objects to be faked with dummy files Returns: - True if one or more external blobs are missing, False if all are present + True if one or more external blobs are missing or faked, + False if all are present """ if get_contents: image.SetAllowMissing(allow_missing) + image.SetAllowFakeBlob(allow_fake_blobs) image.GetEntryContents() image.GetEntryOffsets() @@ -570,7 +574,13 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True, tout.Warning("Image '%s' is missing external blobs and is non-functional: %s" % (image.name, ' '.join([e.name for e in missing_list]))) _ShowHelpForMissingBlobs(missing_list) - return bool(missing_list) + faked_list = [] + image.CheckFakedBlobs(faked_list) + if faked_list: + tout.Warning("Image '%s:%s' has faked external blobs and is non-functional: %s" % + (image.name, image.image_name, + ' '.join([e.GetDefaultFilename() for e in faked_list]))) + return bool(missing_list) or bool(faked_list) def Binman(args): @@ -657,13 +667,15 @@ def Binman(args): images = PrepareImagesAndDtbs(dtb_fname, args.image, args.update_fdt, use_expanded) + if args.test_section_timeout: # Set the first image to timeout, used in testThreadTimeout() images[list(images.keys())[0]].test_section_timeout = True - missing = False + invalid = False for image in images.values(): - missing |= ProcessImage(image, args.update_fdt, args.map, - allow_missing=args.allow_missing) + invalid |= ProcessImage(image, args.update_fdt, args.map, + allow_missing=args.allow_missing, + allow_fake_blobs=args.fake_ext_blobs) # Write the updated FDTs to our output files for dtb_item in state.GetAllFdts(): @@ -673,7 +685,7 @@ def Binman(args): data = state.GetFdtForEtype('u-boot-dtb').GetContents() elf.UpdateFile(*elf_params, data) - if missing: + if invalid: tout.Warning("\nSome images are invalid") # Use this to debug the time take to pack the image |