summaryrefslogtreecommitdiff
path: root/bin/tar2sqfs
diff options
context:
space:
mode:
Diffstat (limited to 'bin/tar2sqfs')
-rw-r--r--bin/tar2sqfs/options.c30
-rw-r--r--bin/tar2sqfs/tar2sqfs.126
2 files changed, 35 insertions, 21 deletions
diff --git a/bin/tar2sqfs/options.c b/bin/tar2sqfs/options.c
index 19017a9..b631a1e 100644
--- a/bin/tar2sqfs/options.c
+++ b/bin/tar2sqfs/options.c
@@ -32,8 +32,7 @@ static const char *short_opts = "r:c:b:B:d:X:j:Q:sxekfqThV";
static const char *usagestr =
"Usage: tar2sqfs [OPTIONS...] <sqfsfile>\n"
"\n"
-"Read an uncompressed tar archive from stdin and turn it into a squashfs\n"
-"filesystem image.\n"
+"Read a tar archive from stdin and turn it into a squashfs filesystem image.\n"
"\n"
"Possible options:\n"
"\n"
@@ -79,12 +78,6 @@ static const char *usagestr =
" --quiet, -q Do not print out progress reports.\n"
" --help, -h Print help text and exit.\n"
" --version, -V Print version information and exit.\n"
-"\n"
-"Examples:\n"
-"\n"
-"\ttar2sqfs rootfs.sqfs < rootfs.tar\n"
-"\tzcat rootfs.tar.gz | tar2sqfs rootfs.sqfs\n"
-"\txzcat rootfs.tar.xz | tar2sqfs rootfs.sqfs\n"
"\n";
bool dont_skip = false;
@@ -93,6 +86,26 @@ bool no_tail_pack = false;
sqfs_writer_cfg_t cfg;
char *root_becomes = NULL;
+static void input_compressor_print_available(void)
+{
+ int i = FSTREAM_COMPRESSOR_MIN;
+ const char *name;
+
+ fputs("\nSupported tar compression formats:\n", stdout);
+
+ while (i <= FSTREAM_COMPRESSOR_MAX) {
+ name = fstream_compressor_name_from_id(i);
+
+ if (fstream_compressor_exists(i))
+ printf("\t%s\n", name);
+
+ ++i;
+ }
+
+ fputs("\tuncompressed\n", stdout);
+ fputc('\n', stdout);
+}
+
void process_args(int argc, char **argv)
{
bool have_compressor;
@@ -196,6 +209,7 @@ void process_args(int argc, char **argv)
printf(usagestr, SQFS_DEFAULT_BLOCK_SIZE,
SQFS_DEVBLK_SIZE);
compressor_print_available();
+ input_compressor_print_available();
exit(EXIT_SUCCESS);
case 'V':
print_version("tar2sqfs");
diff --git a/bin/tar2sqfs/tar2sqfs.1 b/bin/tar2sqfs/tar2sqfs.1
index da344ec..300ab81 100644
--- a/bin/tar2sqfs/tar2sqfs.1
+++ b/bin/tar2sqfs/tar2sqfs.1
@@ -7,6 +7,9 @@ tar2sqfs \- create a SquashFS image from a tar archive
.SH DESCRIPTION
Quickly and painlessly turn a tar ball into a SquashFS filesystem image.
.PP
+By default, the program reads the archive from standard input. Compressed
+archives are supported.
+.PP
Possible options:
.TP
\fB\-\-root\-becomes\fR, \fB\-r\fR <dir>
@@ -107,12 +110,17 @@ Currently the program can process v7 format, pre-POSIX ustar, POSIX tar and GNU
tar archives. PAX extension headers are also supported. Global PAX headers are
ignored.
-The support for GNU tar is limited to commonly used subset (i.e. some legacy
+The support for GNU tar is limited to a commonly used subset (i.e. some legacy
extensions that GNU tar itself no longer generates are not supported; neither
-are mutli volume archives).
+are multi volume archives).
+
+The input tar file can either be uncompressed, or stream compressed using
+\fBgzip\fR, \fBxz\fR, \fBzstd\fR or \fBbzip2\fR. The program transparently
+auto-detects and unpacks any stream compressed archive. The exact list of
+supported compressors depends on the compile configuration.
-Extended attributes are supported through the SCHILY.xattr PAX extension
-(favoured by GNU tar and star) or through the LIBARCHIVE.xattr PAX extension.
+Extended attributes are supported through the \fBSCHILY.xattr\fR extension
+(favoured by GNU tar and star) or through the \fBLIBARCHIVE.xattr\fR extension.
If any unsupported section or extended attribute key is encountered in an
archive, a warning message is written to stderr. If the \fB\-\-no\-skip\fR
@@ -133,15 +141,7 @@ environment variables.
.TP
Turn an uncompressed tar archive into a SquashFS image:
.IP
-tar2sqfs rootfs.sqfs < rootfs.tar
-.TP
-Turn a gzip'ed tar archive into a SquashFS image:
-.IP
-zcat rootfs.tar.gz | tar2sqfs rootfs.sqfs
-.TP
-Turn an LZMA2 compressed tar archive into a SquashFS image:
-.IP
-xzcat rootfs.tar.xz | tar2sqfs rootfs.sqfs
+tar2sqfs rootfs.sqfs < rootfs.tar.gz
.SH SEE ALSO
gensquashfs(1), rdsquashfs(1), sqfs2tar(1)
.SH AUTHOR