Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

15. Tar

GNU tar creates and unpacks tape archives, the container of almost every upstream source. It calls xz and gzip for compressed archives, and inside the chroot kpkg runs it to unpack every port’s source, so with those two it completes the set of three tools kpkg’s first builds need. This page shows the commands of script/phases/10_bootstrap/061_tar.sh and explains them.

Source: the archive of the tar port
Installs into: build/fs/usr
Approximate build time: 0.4 SBU

Installation of tar

TAR_SRC=$(extract_port_source tar)

cd "$TAR_SRC"

FORCE_UNSAFE_CONFIGURE=1 ./configure \
    --host=$KDOS_TARGET \
    --build=$(build-aux/config.guess) \
    --prefix=/usr \
    --disable-nls
make
make DESTDIR=$SYSROOT install

script/phases/10_bootstrap/061_tar.sh, lines 24–34

The meaning of the configure options

FORCE_UNSAFE_CONFIGURE=1
tar’s configure stops with you should not run configure as root unless this is set, and the container builds as root. The refusal comes out of a test program that checks mknod, and a cross build never runs that program, so here the variable changes nothing. It is needed by a native build as root, which is how the port is built.
--host=$KDOS_TARGET, --build=$(build-aux/config.guess)
A cross build, with configure running no test program (see Part III).
--prefix=/usr
Install under /usr.
--disable-nls
Build no message catalogues.

Contents of tar

Installed programs: tar in /usr/bin, and rmt, the remote tape server, in /usr/libexec.

Built again later

The tar port is among the first that 20_selfhost builds, inside the chroot, and kpkg adopts the files this step installed. It adds four switches that settle what tar does with file metadata: --with-xattrs builds in extended-attribute support, for --xattrs, and --disable-acl, --without-posix-acls and --without-selinux leave ACL and SELinux support out. The port declares no dependencies, so it links nothing beyond musl, as this build does.

See also