diff options
author | Simon Glass <sjg@chromium.org> | 2021-11-24 07:09:49 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-12-05 19:21:44 +0300 |
commit | 858436dfda11158ea4bb9e17195dba7f62b30b74 (patch) | |
tree | 6af3260b8ed4c50b2c39c68e627b8ce5077c41f7 /tools/binman/image.py | |
parent | 7945077f7934fff2b9a5fba2860fe330e86093f1 (diff) | |
download | u-boot-858436dfda11158ea4bb9e17195dba7f62b30b74.tar.xz |
binman: Allow listing an image created by a newer version
If an older version of binman is used to list images created by a newer
one, it is possible that it will contain entry types that are not
supported. At present this produces an error.
Adjust binman to use a plain 'blob' entry type to cope with this, so the
image can at least be listed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/image.py')
-rw-r--r-- | tools/binman/image.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/binman/image.py b/tools/binman/image.py index cdc58b39a4..891e8b488e 100644 --- a/tools/binman/image.py +++ b/tools/binman/image.py @@ -63,9 +63,13 @@ class Image(section.Entry_section): to ignore 'u-boot-bin' in this case, and build it ourselves in binman with 'u-boot-dtb.bin' and 'u-boot.dtb'. See Entry_u_boot_expanded and Entry_blob_phase for details. + missing_etype: Use a default entry type ('blob') if the requested one + does not exist in binman. This is useful if an image was created by + binman a newer version of binman but we want to list it in an older + version which does not support all the entry types. """ def __init__(self, name, node, copy_to_orig=True, test=False, - ignore_missing=False, use_expanded=False): + ignore_missing=False, use_expanded=False, missing_etype=False): super().__init__(None, 'section', node, test=test) self.copy_to_orig = copy_to_orig self.name = 'main-section' @@ -75,6 +79,7 @@ class Image(section.Entry_section): self.fdtmap_data = None self.allow_repack = False self._ignore_missing = ignore_missing + self.missing_etype = missing_etype self.use_expanded = use_expanded self.test_section_timeout = False if not test: @@ -124,7 +129,8 @@ class Image(section.Entry_section): # Return an Image with the associated nodes root = dtb.GetRoot() - image = Image('image', root, copy_to_orig=False, ignore_missing=True) + image = Image('image', root, copy_to_orig=False, ignore_missing=True, + missing_etype=True) image.image_node = fdt_util.GetString(root, 'image-node', 'image') image.fdtmap_dtb = dtb |