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

98.21. ndctl-85

Userspace tools and libraries for NVDIMM, DAX and CXL devices (ndctl, daxctl, cxl)

Version 85, release 1
Shelf disk — Block devices: partitioning, RAID, LVM, block encryption, SMART, NVMe, recovery, image writing and async I/O
Phase 41_system (System), 404 of 1047 in build order
Licence GPL-2.0-only AND LGPL-2.1-only AND CC0-1.0 AND MIT
Homepage https://github.com/pmem/ndctl
Build time 1.6 SBU
Installed size 1.4 MiB in 98 files
Recipe ports/core/disk/ndctl/kpkgbuild

About

ndctl is the set of user-space tools and libraries for the kernel’s persistent-memory and CXL memory subsystems: ndctl manages NVDIMM regions and namespaces, daxctl manages DAX devices (including handing device memory to the kernel as ordinary system RAM), and cxl lists and configures CXL memory devices, ports and regions. Its libraries, libndctl, libdaxctl and libcxl, are what libblockdev, configured --with-nvdimm, links.

Sources

Dependencies

Depends on: meson, ninja, pkgconf, kmod, eudev, util-linux, json-c, keyutils, iniparser, libtraceevent, libtracefs, asciidoctor, bash-completion.

Required by (1): libblockdev.

Patches

build.sh applies these; kpkg applies nothing by itself.

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 ndctl'

What kpkg does

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

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/disk/ndctl
echo '69039ee12c75c44f67b5fa3f1abb61d1c38ff9303021e50cec0b45801cc93b2e  ndctl-85.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/ndctl
SRC=$SRC_ROOT/ndctl-85
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf ndctl-85.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 five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/strerror.patch"

meson setup build \
	--prefix=/usr --sysconfdir=/etc --libdir=lib \
	--buildtype=release \
	-Dversion-tag=$version \
	-Dsystemd=disabled \
	-Ddocs=enabled \
	-Dasciidoctor=enabled \
	-Dlibtracefs=enabled \
	-Dkeyutils=enabled \
	-Dtest=disabled \
	-Dbashcompletiondir=/usr/share/bash-completion/completions
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

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/ndctl, 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 ndctl-85-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/ndctl, and runs the triggers its paths call for.

Contents

Installed programs: cxl, daxctl, ndctl.

Installed libraries: libcxl.so, libdaxctl.so, libndctl.so.

Installed directories: /etc/daxctl.conf.d, /etc/ndctl, /etc/ndctl.conf.d, /usr/include/daxctl, /usr/include/ndctl, /usr/share/daxctl, /usr/share/licenses/ndctl.

Short descriptions

cxl Provides enumeration and provisioning commands for CXL platforms
daxctl Provides enumeration and provisioning commands for the Linux kernel Device-DAX facility
ndctl Manage "libnvdimm" subsystem devices (Non-volatile Memory)
libcxl.pc Manage CXL devices
libdaxctl.pc Manage "Device DAX" devices
libndctl.pc Manage "libnvdimm" subsystem devices (Non-volatile Memory)