From 0f89517d418ff907fd9cf51f5313974812ceb305 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 24 Nov 2019 00:45:03 +0100 Subject: Fix: Move LZO compressor from libsquashfs to libcommon The liblzo2 library is licensed under GPLv2, so it is not possible to distribute binaries of libsquashfs that link against liblzo2 under LGPL. This commit moves the LZO compressor implementation to libcommon, where this isn't a problem, since the tools themselves are licensed under GPLv3. It removes the ability of libsquashfs to read or generate LZO compressed SquashFS images, but the tools still can. Signed-off-by: David Oberhollenzer --- lib/common/compress.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/common/compress.c') diff --git a/lib/common/compress.c b/lib/common/compress.c index 04e1f40..a2f53c2 100644 --- a/lib/common/compress.c +++ b/lib/common/compress.c @@ -19,12 +19,20 @@ E_SQFS_COMPRESSOR compressor_get_default(void) void compressor_print_available(void) { + bool have_compressor; int i; fputs("Available compressors:\n", stdout); for (i = SQFS_COMP_MIN; i <= SQFS_COMP_MAX; ++i) { - if (sqfs_compressor_exists(i)) + have_compressor = sqfs_compressor_exists(i); + +#ifdef WITH_LZO + if (i == SQFS_COMP_LZO) + have_compressor = true; +#endif + + if (have_compressor) printf("\t%s\n", sqfs_compressor_name_from_id(i)); } -- cgit v1.2.3