summaryrefslogtreecommitdiff
path: root/tools/binman/state.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-18 20:25:07 +1300
committerSimon Glass <sjg@chromium.org>2021-03-26 17:03:09 +1300
commit06684927289fb0ad0856fa897bbee10de61137e4 (patch)
tree07eee9eb67591ebc42f4cc9d163798be3c9ab643 /tools/binman/state.py
parent0b6023ee41add24ebb9df215ceaec0a803d6c552 (diff)
binman: Automatically expand phase binaries into sections
When creating an entry, check for an expanded version of that entry, then use it instead. This allows, for example use of: u-boot { }; instead of having to write out in full: u-boot { type = "section"; u-boot-nodtb { }; u-boot-dtb { }; }; Add an implementaion of this and associated documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/state.py')
-rw-r--r--tools/binman/state.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/binman/state.py b/tools/binman/state.py
index 84f606b1885..dfb17604554 100644
--- a/tools/binman/state.py
+++ b/tools/binman/state.py
@@ -141,12 +141,16 @@ def SetEntryArgs(args):
global entry_args
entry_args = {}
+ tout.Debug('Processing entry args:')
if args:
for arg in args:
m = re.match('([^=]*)=(.*)', arg)
if not m:
raise ValueError("Invalid entry arguemnt '%s'" % arg)
- entry_args[m.group(1)] = m.group(2)
+ name, value = m.groups()
+ tout.Debug(' %20s = %s' % (name, value))
+ entry_args[name] = value
+ tout.Debug('Processing entry args done')
def GetEntryArg(name):
"""Get the value of an entry argument
@@ -159,6 +163,19 @@ def GetEntryArg(name):
"""
return entry_args.get(name)
+def GetEntryArgBool(name):
+ """Get the value of an entry argument as a boolean
+
+ Args:
+ name: Name of argument to retrieve
+
+ Returns:
+ False if the entry argument is consider False (empty, '0' or 'n'), else
+ True
+ """
+ val = GetEntryArg(name)
+ return val and val not in ['n', '0']
+
def Prepare(images, dtb):
"""Get device tree files ready for use