TAR2SQFS(1)

NAME
tar2sqfs - create a SquashFS image from a tar archive

SYNOPSIS
tar2sqfs [OPTIONS...] <sqfsfile>

DESCRIPTION
Read an uncompressed tar archive from stdin and turn it into a SquashFS filesystem image. The idea is to quickly and painlessly turn a tar ball into a SquashFS filesystem image, so existing tools that work with tar can be used for SquashFS.

Possible options:

--root-becomes, -r <dir>
    If set, only pack entries that are underneath the specified directory and the prefix is stripped. The meta data for the directory itself is copied to the root inode, i.e. the ownership, permissions, extended attributes (unless --no-xattrset), and modification time (unless --no-keep-time is set). If this option is not set, tar2sqfs implicitly treats ./ or absolute paths this way, i.e. if the archive contains an entry for ./, it becomes the root node and the prefix is stripped from all paths (and similar for absolute paths and /).

--compressor, -c <name>
    Select the compressor to use. Run tar2sqfs --help to get a list of all available compressors and the default selection.

--comp-extra, -X <options>
    A comma separated list of extra options for the selected compressor. Specify help to get a list of available options.

--num-jobs, -j <count>
    If libsquashfs was compiled with a thread pool based, parallel data compressor, this option can be used to set the number of compressor threads. If not set, the default is the number of available CPU cores.

--queue-backlog, -Q <count>
    Maximum number of data blocks in the thread worker queue before the packer starts waiting for the block processors to catch up. Higher values result in higher memory consumption. Defaults to 10 times the number of workers.

--block-size, -b <size>
    Block size to use for SquashFS image. Defaults to 131072.

--dev-block-size, -B <size>
    Device block size to padd the image to. Defaults to 4096.

--defaults, -d <options>
    A comma separated list of default values for implicitly created directories. The following values can be set:
    Option | Default
    uid=<value> | 0
    gid=<value> | 0
    mode=<value> | 0755
    mtime=<value> | $SOURCE_DATE_EPOCH if set, 0 otherwise

--no-keep-time, -k
    Replace the time stamps from the tar archive with default time stamps for all entries. The default behavior if not specified, is to preserve the time stamps from the archive to the extent possible (SquashFS has second resolution and 32 bit time stamps; tar can use extensions to specify much larger timestamps with arbitrary precision). The root inode and the modification time on the SquashFS image itself will always still be set to defaults.

--no-xattr, -x
    Do not copy extended attributes from archive. Default behaviour is to copy all extended attributes and skip the ones that cannot be encoded in SquashFS.

--no-skip, -s
    Abort if a tar record cannot be read instead of skipping it.

--exportable, -e
    Generate an export table for NFS support.

--force, -f
    Overwrite the output file if it exists.

--quiet, -q
    Do not print out progress reports.

--help, -h
    Print help text and exit.

--version, -V
    Print version information and exit.

COMPATIBILITY
Currently the program can process v7 format, pre-POSIX ustar, POSIX tar and GNU tar archives. PAX extension headers are also supported. The support for GNU tar is limited to commonly used subset (i.e. some legacy extensions that GNU tar itself no longer generates are not supported; neither are mutli volume archives). Hard links are currently not supported and silently converted to symlinks. Extended attributes are supported through the SCHILY.xattr PAX extension (favoured by GNU tar and star) or through the LIBARCHIVE.xattr PAX extension. If any unsupported section or extended attribute key is encountered in an archive a warning message is written to stderr. If the --no-skip option is set, processing aborts. By default, unknown sections and unsupported extended attributes are simply skipped after issuing a warning.

ENVIRONMENT
If the command line switch --defaults is not used or no default mtime is specified, the value of the environment variable SOURCE_DATE_EPOCH is used for all file and filesystem timestamps. If SOURCE_DATE_EPOCH is not set, not a parsable number or it is out of range, the timestamps default to 0. Environment variables are only used if no explicit command line switches are set. Explicit command line switches are always preferred over the environment variables.

EXAMPLES

Turn an uncompressed tar archive into a SquashFS image:

    tar2sqfs rootfs.sqfs < rootfs.tar

Turn a gzip'ed tar archive into a SquashFS image:

    zcat rootfs.tar.gz | tar2sqfs rootfs.sqfs

Turn an LZMA2 compressed tar archive into a SquashFS image:

    xzcat rootfs.tar.xz | tar2sqfs rootfs.sqfs

SEE ALSO
gensquashfs(1), rdsquashfs(1), sqfs2tar(1)

AUTHOR
Written by David Oberhollenzer.

COPYRIGHT
Copyright © 2019 David Oberhollenzer License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.