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
ndctl-85.tar.gz(452.9 KiB)
sha25669039ee12c75c44f67b5fa3f1abb61d1c38ff9303021e50cec0b45801cc93b2e
upstream: https://github.com/pmem/ndctl/archive/v85.tar.gz
archive copy: sources-1/disk--ndctl-85.tar.gz
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.
strerror.patch— Inutil/help.c, replaces the twostrerror_r(errno, sbuf, sizeof(sbuf))calls whose result is printed with%s, and their buffers, withstrerror(errno). The code expects glibc’s GNUstrerror_r, which returns the message as achar *; musl has only the POSIXstrerror_r, which returns anintand writes the message into the buffer.
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:
-Dversion-tag=$version— Writes the version intoversion.hdirectly. Without it the build runstools/meson-vcs-tag.sh, which asksgit describefor the version and falls back to the project version only when the source is not a git checkout.-Dsystemd=disabled— On by default, it makes setup require systemd’s and udev’s pkg-config files, and installsndctl-monitor.service,cxl-monitor.service, thedaxdev-reconfigure@.servicetemplate and90-daxctl-device.rules, a udev rule whose only action is to ask systemd to start that template for a new DAX device. KDOS has no systemd (see No systemd), so setup would stop at the missingsystemd.pc, and none of the files would do anything.-Ddocs=enabled,-Dasciidoctor=enabled— Build the manual pages, with asciidoctor rather than asciidoc and xmlto. Both are upstream’s defaults, stated; with both enabled, a missingasciidoctoris a configure error.-Dlibtracefs=enabled— On by default. Buildscxl monitorandcxl list --media-errors, which read kernel trace events through libtracefs and libtraceevent.-Dkeyutils=enabled— On by default. Builds NVDIMM passphrase management (ndctl setup-passphrase,update-passphrase,remove-passphraseandload-keys), which stores the keys in the kernel keyring through keyutils.-Dtest=disabled— Does not build or install the test programs; this is upstream’s default as well.-Dbashcompletiondir=/usr/share/bash-completion/completions— Where the completion for the three tools goes. Left empty, meson asks bash-completion’s pkg-config file and falls back to the same directory; named, the result does not depend on that lookup.
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) |