new file mode 100644
@@ -0,0 +1,30 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (C) 2022 Weidmüller Interface GmbH & Co. KG
+# Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
+#
+"""Bintool implementation for lzop
+
+lzop allows compression and decompression of files.
+
+Documentation is available via::
+
+ man lzop
+"""
+
+from binman import bintool
+
+# pylint: disable=C0103
+class Bintoollzop(bintool.BintoolPacker):
+ """Compression/decompression using the lzop algorithm
+
+ This bintool supports running `lzop` to compress and decompress data, as
+ used by binman.
+
+ It is also possible to fetch the tool, which uses `apt` to install it.
+
+ Documentation is available via::
+
+ man lzop
+ """
+ def __init__(self, name):
+ super().__init__(name, 'lzo', compress_args=[])
@@ -11,6 +11,7 @@ This supports the following compression algorithm:
gzip
lz4
lzma
+ lzo
Note that for lzma this uses an old version of the algorithm, not that
provided by xz.
@@ -20,6 +21,7 @@ This requires the following tools:
gzip
lz4
lzma_alone
+ lzop
It also requires an output directory to be previously set up, by calling
PrepareOutputDir().
@@ -31,7 +33,7 @@ from binman import bintool
from patman import tools
# Supported compression algorithms
-ALGORITHMS = ['bzip2', 'gzip', 'lz4', 'lzma']
+ALGORITHMS = ['bzip2', 'gzip', 'lz4', 'lzma', 'lzo']
bintools = {}
@@ -44,7 +46,7 @@ def _get_tool_name(algo):
Returns:
str: Tool name
"""
- names = {'lzma': 'lzma_alone'}
+ names = {'lzma': 'lzma_alone', 'lzo': 'lzop'}
return names.get(algo, algo)
def _get_tool(algo):