mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
binman: Use binary mode when compressing data
The lz4 utility inserts binary data in its output which cannot always be converted to unicode (nor should it be). Fix this by using the new binary mode for program output. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
a92939a4aa
commit
b8f0876f1e
2 changed files with 2 additions and 2 deletions
|
@ -60,7 +60,7 @@ class Entry_blob(Entry):
|
|||
except AttributeError:
|
||||
data = lz4.compress(data)
|
||||
'''
|
||||
data = tools.Run('lz4', '-c', self._pathname)
|
||||
data = tools.Run('lz4', '-c', self._pathname, binary=True)
|
||||
self.SetContents(data)
|
||||
return True
|
||||
|
||||
|
|
|
@ -1557,7 +1557,7 @@ class TestFunctional(unittest.TestCase):
|
|||
out = os.path.join(self._indir, 'lz4.tmp')
|
||||
with open(out, 'wb') as fd:
|
||||
fd.write(data)
|
||||
return tools.Run('lz4', '-dc', out)
|
||||
return tools.Run('lz4', '-dc', out, binary=True)
|
||||
'''
|
||||
try:
|
||||
orig = lz4.frame.decompress(data)
|
||||
|
|
Loading…
Add table
Reference in a new issue