summaryrefslogtreecommitdiff
path: root/tools/binman/state.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-07-24 16:24:50 -0400
committerTom Rini <trini@konsulko.com>2019-07-24 16:24:50 -0400
commitf9b65c76b4828efbf8093c6b02bee5af0045b98b (patch)
tree1429cb8e3cdfea42b63778ddf06ad0b33fb7bcf0 /tools/binman/state.py
parenta9aa4c5700c68c070d63a391b51ea8d341b6e8a6 (diff)
parent44e02e39a91cd91aae5a28d90259d3a6996010bf (diff)
Merge tag 'dm-pull-24jul19-take3' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Minor driver-model fixes and tweaks A few device-tree fixes Binman support for extracting files from an image
Diffstat (limited to 'tools/binman/state.py')
-rw-r--r--tools/binman/state.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/tools/binman/state.py b/tools/binman/state.py
index af9678649c..382bda3221 100644
--- a/tools/binman/state.py
+++ b/tools/binman/state.py
@@ -31,6 +31,11 @@ fdt_subset = set()
# The DTB which contains the full image information
main_dtb = None
+# Allow entries to expand after they have been packed. This is detected and
+# forces a re-pack. If not allowed, any attempted expansion causes an error in
+# Entry.ProcessContentsUpdate()
+allow_entry_expansion = True
+
def GetFdt(fname):
"""Get the Fdt object for a particular device-tree filename
@@ -59,7 +64,7 @@ def GetFdtPath(fname):
"""
return fdt_files[fname]._fname
-def GetFdtContents(fname):
+def GetFdtContents(fname='u-boot.dtb'):
"""Looks up the FDT pathname and contents
This is used to obtain the Fdt pathname and contents when needed by an
@@ -250,3 +255,22 @@ def CheckSetHashValue(node, get_data_func):
data = m.digest()
for n in GetUpdateNodes(hash_node):
n.SetData('value', data)
+
+def SetAllowEntryExpansion(allow):
+ """Set whether post-pack expansion of entries is allowed
+
+ Args:
+ allow: True to allow expansion, False to raise an exception
+ """
+ global allow_entry_expansion
+
+ allow_entry_expansion = allow
+
+def AllowEntryExpansion():
+ """Check whether post-pack expansion of entries is allowed
+
+ Returns:
+ True if expansion should be allowed, False if an exception should be
+ raised
+ """
+ return allow_entry_expansion