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

39.16. eudev-3.2.14

Programs for dynamic creation of device nodes

The build-state snapshot was taken from 3.2.14-1; this recipe is 3.2.14-2, so the size, time and contents below describe the earlier build.

Version 3.2.14, release 2
Shelf base — The minimal userland and system daemons that every KDOS image boots with
Phase 30_foundation (Build Foundation), 77 of 127 in build order
Licence GPL-2.0-or-later AND LGPL-2.1-or-later
Homepage https://github.com/eudev-project/eudev
Build time 0.8 SBU
Installed size 10.0 MiB in 80 files
Recipe ports/core/base/eudev/kpkgbuild

About

eudev is the device manager: udevd receives the kernel’s device events, creates and names the nodes and links under /dev, sets their owners and permissions from its rules, loads the driver a device needs, and tells the rest of the system through libudev. It is a fork of systemd’s udev that builds without systemd, and KDOS uses it in place of systemd-udevd (see No systemd). The 01_udev boot script starts it, the initramfs carries udevd and udevadm with the rules (see The initramfs), and libudev is what the session’s input, storage, audio, Bluetooth and camera stacks link to find their devices.

KDOS’s own rules are the files in fs/etc/udev/rules.d, which the file-system overlay places in /etc/udev/rules.d. The hardware database is compiled once over the finished tree rather than by this port (see Databases stamped into the image).

Sources

Dependencies

Depends on: util-linux, kmod, gperf.

Required by (82): ardour, bluez, bolt, brltty, btrfs-progs, chromium, ddcutil, dhcpcd, direwolf, e2fsprogs, elogind, f3, fuse, glmark2, gvfs, hatari, hidapi, hwloc, iio-sensor-proxy, kcoreaddons, kdeconnect, kdeplasma-addons, kinfocenter, kodi, kpmcore, ksystemstats, kwin, libatasmart, libblockdev, libcamera, libcanberra, libcec, libfido2, libfprint, libgudev, libinput, libksysguard, libqmi, libstoragemgmt, libusb, libvirt, libwacom, linuxcnc, lirc, lvm2, mdadm, mesa, mesa-opencl, modemmanager, ndctl, nut, nvtop, obs-studio, opencpn, openfpgaloader, orcaslicer, pciutils, pcsc-lite, pipewire, plasma-desktop, plasma-workspace, powerdevil, prusaslicer, qemu, qt5-qtbase, qt5-qtserialport, qt6-qtbase, qt6-qtserialport, qt6-qtwebengine, qv4l2, retroarch, sdl3, solid, spice, switcheroo-control, udftools, udisks2, usbmuxd, usbutils, v4l-utils, vlc, wine.

Patches

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

watch-reread-changed-table.patch changes synthesize_change() in src/udev/udevd.c, which runs when a program closes a watched disk it had open for writing (60-block.rules puts OPTIONS+="watch" on the sd*, vd*, nvme*, mmcblk*, loop* and other block devices it lists). Upstream takes the disk’s lock and asks the kernel to re-read its partition table (BLKRRPART) on every such close, and the re-read removes and re-adds every partition node even when the table is the same.

The patch first reads the table on the disk with libblkid, read-only, and compares it with the kernel’s partitions by number, start and size (an extended partition by its start alone, because the kernel gives it a size of one or two sectors). When they match, it skips the re-read and sends change for the disk and each partition, which re-runs the rules without touching the nodes. When the table differs, or libblkid cannot read it, the table is re-read as upstream does.

Without the patch, a program that writes the whole disk, closes it and then opens one of its partitions finds the node gone while udevd’s own re-read runs. Ventoy’s Ventoy2Disk.sh -I does exactly that between cleaning its second partition and formatting the first with mkexfatfs, and loses /dev/sda1 in a live session.

The patch also gives udevd libblkid’s compiler flags and library in src/udev/Makefile.am, which autoreconf carries into the build. It is to be offered upstream to eudev.

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/30_foundation/phase.env && kpkg install eudev'

What kpkg does

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

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/base/eudev
echo 'c340e6c51dfc5531ac0c0fa84a34b72162acf525f9023eb9cf4931b782c8f177  eudev-3.2.14.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/eudev
SRC=$SRC_ROOT/eudev-3.2.14
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf eudev-3.2.14.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/watch-reread-changed-table.patch"

autoreconf -f -i -s
./configure --enable-manpages \
	--prefix=/usr \
	--bindir=/sbin \
	--sbindir=/sbin \
	--libdir=/usr/lib \
	--sysconfdir=/etc \
	--libexecdir=/lib \
	--with-rootprefix= \
	--with-rootlibdir=/lib \
	--enable-blkid \
	--enable-kmod \
	--disable-selinux
make

mkdir -pv $PKG/lib/udev/rules.d
mkdir -pv $PKG/etc/udev/rules.d

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/eudev, 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 eudev-3.2.14-2.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/eudev, and runs the triggers its paths call for.

Contents

Installed programs: udevadm, udevd.

Installed libraries: libudev.a, libudev.so.

Installed directories: /etc/udev, /usr/share/licenses/eudev.

Short descriptions

udevadm udev management tool
udevd Device event managing daemon
libudev.pc Library to access udev device information
udev.pc eudev

Notes

The source is a GitHub tag archive with no generated configure, so build.sh runs autoreconf -f -i -s first; the autotools are in the phase’s opening run, ahead of every shelf.

eudev needs util-linux’s libblkid, so util-linux is built before it, and without libudev. The cost is in Known gaps.

udev.pc carries udevdir=/lib/udev, and a port that installs rules or helpers by asking pkg-config for that variable puts them there.