SETS2ROOTFS(1)

NAME
sets2rootfs - create rootfs for NetBSD and OpenBSD from sets files

SYNOPSIS
sets2rootfs [-C] [-Q] [-c cache_dir] [-D | -d root_dir] [-u url] [-i set] [-I set_prefix] [-x set] [-X set_prefix]
sets2rootfs [-C] [-Q] [-c cache_dir] [-D | -d root_dir] [-s os] [-r os_release] [-m os_arch] [-i set] [-I set_prefix] [-x set] [-X set_prefix]

DESCRIPTION
sets2rootfs downloads cksum file for NetBSD/OpenBSD sets, checks the checksums and unpacks downloaded sets, thus creating a template for rootfs of the system.

The following options are available:

-c  This option specifies the directory for cache, where all sets are downloaded before unpacking. This is a mandatory option.

-C  Remove cache directory after successful unpacking sets.

-d  Directory for rootfs. This is a mandatory option.

-D  Download sets and check cksums, but do not unpack them.

-i  Download and unpack only the specified set. This option can be applied multiple times.

-I  Download and unpack only sets having the specified prefix. This option can be applied multiple times.

-m  Machine architecture. The default is architecture of running operating system.

-q  Do not send progress messages to stderr.

-r  Operating system release. The default is a version of running operating system.

-s  Operating system. Currently either NetBSD or OpenBSD. The default is a running operating system.

-u  URL of filename to SHA256, SHA512 or similar file that describes cksums for sets. The default is https://cdn.netbsd.org/pub/NetBSD/NetBSD-$release/$machine/binary/sets/SHA512 for NetBSD and https://cdn.openbsd.org/pub/OpenBSD/$release/$machine/SHA256 for OpenBSD.

-x  Do not download and unpack the specified set. This option can be applied multiple times.

-X  Do not download and unpack sets having the specified prefix. This option can be applied multiple times.

ENVIRONMENT
The following environment variables affect the execution of sets2rootfs:

FTP_CMD
    If set, the specified command is used for downloading. The default is ftp.

FTP_CALL
    This variable overrides the default $FTP_CMD -v -o.

CKSUM_CMD
    If set, the specified command is used for calculating cksum. The default is cksum.

CKSUM_CALL
    This variable overrides the default $CKSUM_CMD -a.

TAR_CMD
    If set, the specified command is used for unpacking. The default is tar.

TAR_OPTS
    Options passed to $TAR_CMD in addition to -xpf. The default is -z.

EXAMPLES
     # sets2rootfs -c /tmp/OpenBSD-7.5.cache -s OpenBSD -r 7.5 -d /var/chroots/OpenBSD-7.5
     # sets2rootfs -c /tmp/NetBSD-10.cache -d /var/chroots/NetBSD-10
     # sets2rootfs -c /tmp/NetBSD.cache -d /var/chroots/NetBSD \
        -Xx -Xkern -xgames -xgpufw -xrescue -xmodules
     # sets2rootfs -c /tmp/NetBSD.cache -d /var/chroots/NetBSD -r 9.4 \
        -i base -i etc
     # sets2rootfs -c /tmp/NetBSD.cache -d /var/chroots/NetBSD-20240513 \
        -u http://nyftp.netbsd.org/pub/NetBSD-daily/HEAD/latest/riscv-riscv64/binary/sets/MD5
     # env FTP_CALL='wget -O' CKSUM_CALL='digest' sets2rootfs \
        -c /tmp/OpenBSD-7.5.cache -s OpenBSD -mamd64 -r 7.5 \
        -d /tmp/rootfs-OpenBSD-7.5

EXIT STATUS