aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/tools.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-07-20 12:23:36 -0600
committerSimon Glass <sjg@chromium.org>2019-07-29 09:38:05 -0600
commit9f297b09c06f2212cb59dac5950ae61de5fe3a9f (patch)
tree2f63132f9076b2a41511bd0e72fafcf1fe5d5680 /tools/patman/tools.py
parentfd07336211c3b3088dce20b1c22a99e6303c68c2 (diff)
downloadu-boot-9f297b09c06f2212cb59dac5950ae61de5fe3a9f.zip
u-boot-9f297b09c06f2212cb59dac5950ae61de5fe3a9f.tar.gz
u-boot-9f297b09c06f2212cb59dac5950ae61de5fe3a9f.tar.bz2
binman: Add a bit of logging in entries when packing
Use the new logging feature to log information about progress with packing. This is useful to see how binman is figuring things out. Also update elf.py to use the same feature. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/tools.py')
-rw-r--r--tools/patman/tools.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/patman/tools.py b/tools/patman/tools.py
index e945b54..f492dc8 100644
--- a/tools/patman/tools.py
+++ b/tools/patman/tools.py
@@ -473,3 +473,19 @@ def RunIfwiTool(ifwi_file, cmd, fname=None, subpart=None, entry_name=None):
if entry_name:
args += ['-d', '-e', entry_name]
Run(*args)
+
+def ToHex(val):
+ """Convert an integer value (or None) to a string
+
+ Returns:
+ hex value, or 'None' if the value is None
+ """
+ return 'None' if val is None else '%#x' % val
+
+def ToHexSize(val):
+ """Return the size of an object in hex
+
+ Returns:
+ hex value of size, or 'None' if the value is None
+ """
+ return 'None' if val is None else '%#x' % len(val)