diff options
author | Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> | 2022-08-19 16:25:27 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-08-20 18:07:33 -0600 |
commit | 4f463e3dee863cdfeb34f37bcca6ae0cb46f7b51 (patch) | |
tree | 2dd4c6717c07e533f9397f6c6685341e86eecbea /tools/binman/comp_util.py | |
parent | 9f74395ee5482aaa7a03b48201773fb9bc08c72e (diff) |
binman: Remove obsolete compressed data header handling
Remove the obsolete compressed data header handling from the utilities
to compress and decompress data. The header is uncommon, not supported
by U-Boot and incompatible with external compressed artifacts.
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/comp_util.py')
-rw-r--r-- | tools/binman/comp_util.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tools/binman/comp_util.py b/tools/binman/comp_util.py index dc76adab352..269bbf79756 100644 --- a/tools/binman/comp_util.py +++ b/tools/binman/comp_util.py @@ -3,7 +3,6 @@ # """Utilities to compress and decompress data""" -import struct import tempfile from binman import bintool @@ -16,7 +15,7 @@ LZMA_ALONE = bintool.Bintool.create('lzma_alone') HAVE_LZMA_ALONE = LZMA_ALONE.is_present() -def compress(indata, algo, with_header=True): +def compress(indata, algo): """Compress some data using a given algorithm Note that for lzma this uses an old version of the algorithm, not that @@ -41,12 +40,9 @@ def compress(indata, algo, with_header=True): data = LZMA_ALONE.compress(indata) else: raise ValueError("Unknown algorithm '%s'" % algo) - if with_header: - hdr = struct.pack('<I', len(data)) - data = hdr + data return data -def decompress(indata, algo, with_header=True): +def decompress(indata, algo): """Decompress some data using a given algorithm Note that for lzma this uses an old version of the algorithm, not that @@ -64,9 +60,6 @@ def decompress(indata, algo, with_header=True): """ if algo == 'none': return indata - if with_header: - data_len = struct.unpack('<I', indata[:4])[0] - indata = indata[4:4 + data_len] if algo == 'lz4': data = LZ4.decompress(indata) elif algo == 'lzma': |