summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>2022-08-19 16:25:22 +0200
committerSimon Glass <sjg@chromium.org>2022-08-20 18:07:33 -0600
commit917b3c37ae10cc2a965cfc7d7eb701e5f0b75c39 (patch)
tree356b83c32478927f77c552944414ca183d405787
parenta55596514144532ec2db1a50e7bf82c7bdfb5230 (diff)
downloadu-boot-917b3c37ae10cc2a965cfc7d7eb701e5f0b75c39.tar.gz
u-boot-917b3c37ae10cc2a965cfc7d7eb701e5f0b75c39.tar.bz2
u-boot-917b3c37ae10cc2a965cfc7d7eb701e5f0b75c39.zip
binman: Collect bintools before usage
Collect and thereby initialize bintools before any usage but after generation of entries. This is needed to handle bintools for compress and decompress like other bintools. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--tools/binman/control.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 8eea864d45..bfe63a1520 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -216,6 +216,7 @@ def ReadEntry(image_fname, entry_path, decomp=True):
from binman.image import Image
image = Image.FromFile(image_fname)
+ image.CollectBintools()
entry = image.FindEntryPath(entry_path)
return entry.ReadData(decomp)
@@ -252,6 +253,7 @@ def ExtractEntries(image_fname, output_fname, outdir, entry_paths,
List of EntryInfo records that were written
"""
image = Image.FromFile(image_fname)
+ image.CollectBintools()
if alt_format == 'list':
ShowAltFormats(image)
@@ -371,6 +373,7 @@ def WriteEntry(image_fname, entry_path, data, do_compress=True,
"""
tout.info("Write entry '%s', file '%s'" % (entry_path, image_fname))
image = Image.FromFile(image_fname)
+ image.CollectBintools()
entry = image.FindEntryPath(entry_path)
WriteEntryToImage(image, entry, data, do_compress=do_compress,
allow_resize=allow_resize, write_map=write_map)
@@ -508,8 +511,8 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded):
# without changing the device-tree size, thus ensuring that our
# entry offsets remain the same.
for image in images.values():
- image.CollectBintools()
image.gen_entries()
+ image.CollectBintools()
if update_fdt:
image.AddMissingProperties(True)
image.ProcessFdt(dtb)