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

104.12. nbdkit-1.48.1

NBD server toolkit with pluggable plugins and filters; serves disks to libvirt and QEMU

Version 1.48.1, release 1
Shelf virt — Virtual machines, their tooling, and remote-desktop and VNC protocols
Phase 41_system (System), 1011 of 1047 in build order
Licence BSD-3-Clause
Homepage https://gitlab.com/nbdkit/nbdkit
Build time 1.6 SBU
Installed size 4.1 MiB in 251 files
Recipe ports/core/virt/nbdkit/kpkgbuild

About

nbdkit is a Network Block Device server built from plugins, each a source of disk data (a file, memory, a URL, an SSH or NFS path, a disk image built on the fly), and filters stacked over them. In KDOS libvirt runs it to serve network disks to guests. configure builds most plugins and filters whenever it finds their library, and only warns when it does not, even for a switch given as --with. build.sh names nearly every switch: those turned off stay off whatever the build root holds, and the libraries of those turned on are in depends.

Sources

Dependencies

Depends on: pkgconf, perl, gnutls, libnbd, libnfs, curl, libssh, zlib, xz, zstd, bzip2, e2fsprogs, libisoburn, bash-completion, libbsd.

Required by (1): libvirt.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install nbdkit'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/virt/nbdkit.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/virt/nbdkit
echo '21ddcdd0bb3cd49ec47aa2d7ca3e69941426e991932b44dc34a856d063f41ead  nbdkit-1.48.1.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/nbdkit
SRC=$SRC_ROOT/nbdkit-1.48.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf nbdkit-1.48.1.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _series and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

./configure \
	--prefix=/usr \
	--sysconfdir=/etc \
	--libdir=/usr/lib \
	--disable-valgrind \
	--disable-probes \
	--disable-perl \
	--disable-python \
	--disable-ocaml \
	--disable-rust \
	--disable-tcl \
	--disable-lua \
	--disable-golang \
	--disable-torrent \
	--disable-vram \
	--disable-vddk \
	--disable-libguestfs-tests \
	--enable-linuxdisk \
	--with-gnutls \
	--with-iconv \
	--with-curl \
	--with-ssh \
	--with-zlib \
	--without-zlib-ng \
	--with-bzip2 \
	--with-liblzma \
	--with-libzstd \
	--with-libnbd \
	--with-ext2 \
	--with-manpages \
	--without-libvirt \
	--with-nfs \
	--with-iso \
	--without-libblkio \
	--without-libguestfs \
	--without-selinux \
	--with-bash-completions \
	--disable-static
make
make DESTDIR=$PKG install

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/nbdkit, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf nbdkit-1.48.1-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/nbdkit, and runs the triggers its paths call for.

Contents

Installed programs: nbdkit.

Installed directories: /usr/lib/nbdkit, /usr/share/licenses/nbdkit.

Short descriptions

nbdkit network block device (NBD) server
nbdkit.pc A toolkit for creating NBD servers