aboutsummaryrefslogtreecommitdiff
path: root/difftool
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-24 00:45:03 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-11-24 01:03:10 +0100
commit0f89517d418ff907fd9cf51f5313974812ceb305 (patch)
treeb8083226dd401a64fd4369777c474af2a15848f8 /difftool
parent5971411b6db1a1e0dab92df37f3974643a3d4399 (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'difftool')
-rw-r--r--difftool/Makemodule.am2
-rw-r--r--difftool/sqfsdiff.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/difftool/Makemodule.am b/difftool/Makemodule.am
index e43f35d..e827a8b 100644
--- a/difftool/Makemodule.am
+++ b/difftool/Makemodule.am
@@ -2,6 +2,6 @@ sqfsdiff_SOURCES = difftool/sqfsdiff.c difftool/sqfsdiff.h difftool/util.c
sqfsdiff_SOURCES += difftool/compare_dir.c difftool/node_compare.c
sqfsdiff_SOURCES += difftool/compare_files.c difftool/super.c
sqfsdiff_SOURCES += difftool/extract.c difftool/options.c
-sqfsdiff_LDADD = libcommon.a libsquashfs.la libutil.la
+sqfsdiff_LDADD = libcommon.a libsquashfs.la libutil.la $(LZO_LIBS)
bin_PROGRAMS += sqfsdiff
diff --git a/difftool/sqfsdiff.c b/difftool/sqfsdiff.c
index 7479938..1c80812 100644
--- a/difftool/sqfsdiff.c
+++ b/difftool/sqfsdiff.c
@@ -22,7 +22,14 @@ static int open_sfqs(sqfs_state_t *state, const char *path)
goto fail_file;
}
- if (!sqfs_compressor_exists(state->super.compression_id)) {
+ ret = sqfs_compressor_exists(state->super.compression_id);
+
+#ifdef WITH_LZO
+ if (state->super.compression_id == SQFS_COMP_LZO)
+ ret = true;
+#endif
+
+ if (!ret) {
fprintf(stderr, "%s: unknown compressor used.\n",
path);
goto fail_file;
@@ -33,6 +40,12 @@ static int open_sfqs(sqfs_state_t *state, const char *path)
SQFS_COMP_FLAG_UNCOMPRESS);
state->cmp = sqfs_compressor_create(&state->cfg);
+
+#ifdef WITH_LZO
+ if (state->super.compression_id == SQFS_COMP_LZO && state->cmp == NULL)
+ state->cmp = lzo_compressor_create(&state->cfg);
+#endif
+
if (state->cmp == NULL) {
fprintf(stderr, "%s: error creating compressor.\n", path);
goto fail_file;