summaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-01-10 06:13:50 +0300
committerSimon Glass <sjg@chromium.org>2022-01-25 22:36:11 +0300
commit386c63cfad30901055a7d41173c2a99d268b6b0d (patch)
tree9382d73ce342712062c012ee88cf812b6d4b69e9 /tools/binman/entry.py
parent252de6b1f7189062d984b72149ea4d3123a63d8d (diff)
downloadu-boot-386c63cfad30901055a7d41173c2a99d268b6b0d.tar.xz
binman: Plumb in support for bintools
Support collecting the available bintools needed by an image, by scanning the entries in the image. Also add a command-line interface to access the basic bintool features, such as listing the bintools and fetching them if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index e4a1f2d5d5..9cd900670e 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -10,6 +10,7 @@ import os
import pathlib
import sys
+from binman import bintool
from dtoc import fdt_util
from patman import tools
from patman.tools import ToHex, ToHexSize
@@ -74,6 +75,7 @@ class Entry(object):
allow_fake: Allow creating a dummy fake file if the blob file is not
available. This is mainly used for testing.
external: True if this entry contains an external binary blob
+ bintools: Bintools used by this entry (only populated for Image)
"""
def __init__(self, section, etype, node, name_prefix=''):
# Put this here to allow entry-docs and help to work without libfdt
@@ -105,6 +107,7 @@ class Entry(object):
self.external = False
self.allow_missing = False
self.allow_fake = False
+ self.bintools = {}
@staticmethod
def FindEntryClass(etype, expanded):
@@ -1065,3 +1068,22 @@ features to produce new behaviours.
value: Help text
"""
pass
+
+ def AddBintools(self, tools):
+ """Add the bintools used by this entry type
+
+ Args:
+ tools (dict of Bintool):
+ """
+ pass
+
+ @classmethod
+ def AddBintool(self, tools, name):
+ """Add a new bintool to the tools used by this etype
+
+ Args:
+ name: Name of the tool
+ """
+ btool = bintool.Bintool.create(name)
+ tools[name] = btool
+ return btool