aboutsummaryrefslogtreecommitdiff
path: root/tar
diff options
context:
space:
mode:
Diffstat (limited to 'tar')
-rw-r--r--tar/Makemodule.am3
-rw-r--r--tar/sqfs2tar.c15
-rw-r--r--tar/tar2sqfs.c5
3 files changed, 21 insertions, 2 deletions
diff --git a/tar/Makemodule.am b/tar/Makemodule.am
index ec65d3a..4d28bb7 100644
--- a/tar/Makemodule.am
+++ b/tar/Makemodule.am
@@ -1,8 +1,9 @@
sqfs2tar_SOURCES = tar/sqfs2tar.c
sqfs2tar_LDADD = libcommon.a libsquashfs.la libtar.a libcompat.a libutil.la
+sqfs2tar_LDADD += $(LZO_LIBS)
tar2sqfs_SOURCES = tar/tar2sqfs.c
tar2sqfs_LDADD = libcommon.a libsquashfs.la libtar.a
-tar2sqfs_LDADD += libfstree.a libcompat.a libutil.la
+tar2sqfs_LDADD += libfstree.a libcompat.a libutil.la $(LZO_LIBS)
bin_PROGRAMS += sqfs2tar tar2sqfs
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;
diff --git a/tar/tar2sqfs.c b/tar/tar2sqfs.c
index 10bb091..08bb8b5 100644
--- a/tar/tar2sqfs.c
+++ b/tar/tar2sqfs.c
@@ -126,6 +126,11 @@ static void process_args(int argc, char **argv)
if (!sqfs_compressor_exists(cfg.comp_id))
have_compressor = false;
+#ifdef WITH_LZO
+ if (cfg.comp_id == SQFS_COMP_LZO)
+ have_compressor = true;
+#endif
+
if (!have_compressor) {
fprintf(stderr, "Unsupported compressor '%s'\n",
optarg);