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

357.1. kdos-sysupdated-0.1.0

org.freedesktop.sysupdate1 and io.kdos.Slots1 over the A/B root slots, for Discover

Version 0.1.0, release 1
Source tree src/daemons/kdos-sysupdated/
Phase 50_desktop (Desktop), 61 of 92 in build order
Licence MIT
Homepage https://github.com/kunaldawn/kdos
Build time 0.1 SBU
Installed size 139.5 KiB in 5 files
Recipe src/daemons/kdos-sysupdated/kpkgbuild

About

kdos-sysupdated is the root daemon that lets Plasma’s Discover install a KDOS system update. It owns org.freedesktop.sysupdate1 on the system bus and answers the calls Discover’s stock SystemdSysupdate backend makes: one target, host; its version; an AppStream file describing the update; the newest version (CheckNew); then Acquire, which does all the long work and reports its progress, and Install, which arms the filled slot for the next boot. It does none of that work itself. Every check, download and install is a kdos update run (check --fetch, apply --acquire --mount, apply --arm --mount) and every boot decision a kdos-bootctl run, each exec’d with an argument vector and read through a progress pipe while the bus keeps answering. See Updating a machine and A/B slot selection.

It also serves io.kdos.Slots1, whose contract is the System Versions page’s io.kdos.Slots1.xml: the slots, the armed trial, the update channel, the install route (install = and build-deps = of /etc/kdos/update.conf), Try, CancelTry, SetChannel, SetInstallRoute and Bless. And it is the root half of the session-confirmed boot: it runs kdos-bootctl mark-good once /run/kdos/bless/ holds both the mark the end of rcS writes and the one a Plasma session (through Bless) or a login greeter that stayed up for a minute earns.

The port is KDOS’s own C on basu, with no upstream source; build.sh compiles the daemon with libkbase and installs it beside its bus policy, its two polkit action files and the packaged AppStream file.

Why it is in KDOS

The comment above it in script/phases/50_desktop/packages.txt:

org.freedesktop.sysupdate1 and io.kdos.Slots1 over the A/B root slots: what Discover's system updates and the slots page ask.

Sources

None: the port builds from its own directory, /kdos/src/daemons/kdos-sysupdated.

Dependencies

Depends on: basu, dbus, polkit, kdos-tools.

Required by (2): kcm-kdos-system, kde-plasma.

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/50_desktop/phase.env && kpkg install kdos-sysupdated'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /kdos/src/daemons/kdos-sysupdated.

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.

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/kdos-sysupdated
SRC=$SRC_ROOT/kdos-sysupdated-0.1.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"

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:

LIBS="$PORT_SRC/../../libs"

gcc $CFLAGS -O2 -std=gnu11 -D_GNU_SOURCE -Wall -Wextra \
	$(pkg-config --cflags basu) -I"$LIBS/libkbase" \
	-o kdos-sysupdated "$PORT_SRC"/*.c "$LIBS"/libkbase/*.c \
	$(pkg-config --libs basu) $LDFLAGS

install -Dm755 kdos-sysupdated "$PKG/usr/sbin/kdos-sysupdated"
install -Dm644 "$PORT_SRC/kdos-sysupdated.conf" \
	"$PKG/usr/share/dbus-1/system.d/kdos-sysupdated.conf"
install -Dm644 "$PORT_SRC/org.freedesktop.sysupdate1.policy" \
	"$PKG/usr/share/polkit-1/actions/org.freedesktop.sysupdate1.policy"
install -Dm644 "$PORT_SRC/io.kdos.slots.policy" \
	"$PKG/usr/share/polkit-1/actions/io.kdos.slots.policy"
install -Dm644 "$PORT_SRC/io.kdos.system.metainfo.xml" \
	"$PKG/usr/share/kdos/update/io.kdos.system.metainfo.xml"

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/kdos-sysupdated, 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 kdos-sysupdated-0.1.0-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/kdos-sysupdated, and runs the triggers its paths call for.

Other files in the port directory, read by build.sh: appstream.c, bless.c, bus.c, io.kdos.slots.policy, io.kdos.system.metainfo.xml, job.c, json.c, kdos-sysupdated.conf, main.c, org.freedesktop.sysupdate1.policy, polkit.c, state.c, sysupdated.h, tests/.

Contents

Installed programs: kdos-sysupdated.

Installed directories: /usr/share/kdos/update.

Notes