diff mbox series

[02/10] patman: Correct lz4 compression parameters

Message ID 20210106213503.2.Ice90ef82a59cb480c8364f78f7c796412bffccfd@changeid
State Accepted
Commit 6deff872cf7ac25bf3d67066b57e7831cd560e5b
Delegated to: Simon Glass
Headers show
Series binman: Various minor fixes and improvement | expand

Commit Message

Simon Glass Jan. 7, 2021, 4:35 a.m. UTC
At present on large files, lz4 uses a larger block size (e.g. 256KB) than
the 64KB supported by the U-Boot decompression implementation. Also it is
optimised for maximum compression speed, producing larger output than we
would like.

Update the parameters to correct these problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/patman/tools.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Simon Glass Jan. 23, 2021, 5:27 p.m. UTC | #1
At present on large files, lz4 uses a larger block size (e.g. 256KB) than
the 64KB supported by the U-Boot decompression implementation. Also it is
optimised for maximum compression speed, producing larger output than we
would like.

Update the parameters to correct these problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/patman/tools.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/patman/tools.py b/tools/patman/tools.py
index d8e01a3e60e..10997e43868 100644
--- a/tools/patman/tools.py
+++ b/tools/patman/tools.py
@@ -476,7 +476,8 @@  def Compress(indata, algo, with_header=True):
     fname = GetOutputFilename('%s.comp.tmp' % algo)
     WriteFile(fname, indata)
     if algo == 'lz4':
-        data = Run('lz4', '--no-frame-crc', '-c', fname, binary=True)
+        data = Run('lz4', '--no-frame-crc', '-B4', '-5', '-c', fname,
+                   binary=True)
     # cbfstool uses a very old version of lzma
     elif algo == 'lzma':
         outfname = GetOutputFilename('%s.comp.otmp' % algo)