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 --- mkfs/Makemodule.am | 2 +- mkfs/options.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'mkfs') diff --git a/mkfs/Makemodule.am b/mkfs/Makemodule.am index f4dffa7..0a2b7da 100644 --- a/mkfs/Makemodule.am +++ b/mkfs/Makemodule.am @@ -1,7 +1,7 @@ gensquashfs_SOURCES = mkfs/mkfs.c mkfs/mkfs.h mkfs/options.c gensquashfs_SOURCES += mkfs/dirscan.c mkfs/selinux.c gensquashfs_LDADD = libcommon.a libsquashfs.la libfstree.a -gensquashfs_LDADD += libcompat.a libutil.la $(LIBSELINUX_LIBS) +gensquashfs_LDADD += libcompat.a libutil.la $(LIBSELINUX_LIBS) $(LZO_LIBS) gensquashfs_CPPFLAGS = $(AM_CPPFLAGS) gensquashfs_CFLAGS = $(AM_CFLAGS) $(LIBSELINUX_CFLAGS) diff --git a/mkfs/options.c b/mkfs/options.c index 83f1bae..31b7731 100644 --- a/mkfs/options.c +++ b/mkfs/options.c @@ -168,6 +168,11 @@ void process_command_line(options_t *opt, int argc, char **argv) if (!sqfs_compressor_exists(opt->cfg.comp_id)) have_compressor = false; +#ifdef WITH_LZO + if (opt->cfg.comp_id == SQFS_COMP_LZO) + have_compressor = true; +#endif + if (!have_compressor) { fprintf(stderr, "Unsupported compressor '%s'\n", optarg); -- cgit v1.2.3