summaryrefslogtreecommitdiff
path: root/tools/binman
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-10-31 07:42:50 -0600
committerSimon Glass <sjg@chromium.org>2019-11-04 18:15:32 -0700
commit3b3e3c0f6c261a8c9f989d437dc261ba84467d4f (patch)
treefef28e49d1b53f29979a5a2c5ed88065bcc5fbe9 /tools/binman
parentf0921f5098d8d98ac38121837aaf7c4b4cb13bb4 (diff)
patman: Adjust 'command' to return strings instead of bytes
At present all the 'command' methods return bytes. Most of the time we actually want strings, so change this. We still need to keep the internal representation as bytes since otherwise unicode strings might break over a read() boundary (e.g. 4KB), causing errors. But we can convert the end result to strings. Add a 'binary' parameter to cover the few cases where bytes are needed. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman')
-rwxr-xr-xtools/binman/cbfs_util_test.py2
-rw-r--r--tools/binman/ftest.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/binman/cbfs_util_test.py b/tools/binman/cbfs_util_test.py
index 772c794ece..ddc2e09e35 100755
--- a/tools/binman/cbfs_util_test.py
+++ b/tools/binman/cbfs_util_test.py
@@ -56,7 +56,7 @@ class TestCbfs(unittest.TestCase):
cls.have_lz4 = True
try:
tools.Run('lz4', '--no-frame-crc', '-c',
- tools.GetInputFilename('u-boot.bin'))
+ tools.GetInputFilename('u-boot.bin'), binary=True)
except:
cls.have_lz4 = False
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 494e218cbc..93507993a0 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -174,7 +174,7 @@ class TestFunctional(unittest.TestCase):
cls.have_lz4 = True
try:
tools.Run('lz4', '--no-frame-crc', '-c',
- os.path.join(cls._indir, 'u-boot.bin'))
+ os.path.join(cls._indir, 'u-boot.bin'), binary=True)
except:
cls.have_lz4 = False