diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-09-24 20:19:52 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-09-29 18:19:53 +0200 |
commit | 30e8abe86cc604672dff3896cdea2a75ed622a4f (patch) | |
tree | 8d864199f70e89364e01621b12fca9f336c6c253 /bin/tar2sqfs | |
parent | 4b4cee0c0c99f531a45157fd27f5441e511db109 (diff) |
Update tar2sqfs/sqfs2tar documentation
Modify the man pages and help texts to mention compression support, make
the help option display a list of supported compressors.
Also clarify the squashfs compressor list in the help text to state that
the list shows block compressors supported for SquashFS compression.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/tar2sqfs')
-rw-r--r-- | bin/tar2sqfs/options.c | 30 | ||||
-rw-r--r-- | bin/tar2sqfs/tar2sqfs.1 | 26 |
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 |