diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-11-24 00:45:03 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-11-24 01:03:10 +0100 |
commit | 0f89517d418ff907fd9cf51f5313974812ceb305 (patch) | |
tree | b8083226dd401a64fd4369777c474af2a15848f8 /tar/sqfs2tar.c | |
parent | 5971411b6db1a1e0dab92df37f3974643a3d4399 (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 'tar/sqfs2tar.c')
-rw-r--r-- | tar/sqfs2tar.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tar/sqfs2tar.c b/tar/sqfs2tar.c index 77f4843..9a12a96 100644 --- a/tar/sqfs2tar.c +++ b/tar/sqfs2tar.c @@ -420,7 +420,14 @@ int main(int argc, char **argv) goto out_fd; } - if (!sqfs_compressor_exists(super.compression_id)) { + ret = sqfs_compressor_exists(super.compression_id); + +#ifdef WITH_LZO + if (super.compression_id == SQFS_COMP_LZO) + ret = true; +#endif + + if (!ret) { fprintf(stderr, "%s: unknown compressor used.\n", filename); goto out_fd; } @@ -430,6 +437,12 @@ int main(int argc, char **argv) SQFS_COMP_FLAG_UNCOMPRESS); cmp = sqfs_compressor_create(&cfg); + +#ifdef WITH_LZO + if (super.compression_id == SQFS_COMP_LZO && cmp == NULL) + cmp = lzo_compressor_create(&cfg); +#endif + if (cmp == NULL) { fputs("Error creating compressor.\n", stderr); goto out_fd; |