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

357.7. kdos-settingsd-0.1.0

hostname1, timedate1 and locale1 on the system bus, over the files KDOS keeps

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

About

kdos-settingsd is the root daemon that serves org.freedesktop.hostname1, org.freedesktop.timedate1 and org.freedesktop.locale1 on the system bus: the three interfaces systemd defined for a machine’s name, clock, time zone, locale and keyboards, which KDE calls instead of writing files. The Date & Time page of System Settings saves through timedate1 and nothing else; plasma-setup uses all three; the SDDM greeter runs kwin_wayland --locale1, which takes the login screen’s keyboard layout from locale1 and follows it when it changes; startplasma copies that layout into each session; the system monitor’s OS sensors read hostname1. KDOS has no systemd, so this daemon answers for them, with every method and property systemd’s three interfaces have except hostname1’s Describe, which nothing on the system calls.

Each setting is kept in the file the rest of the machine already reads:

Setting Kept in
static hostname /etc/hostname, set at boot by 05_hostname.sh, with the 127.0.1.1 line of /etc/hosts naming whatever the kernel carries, because musl resolves the machine’s own name from that file and nothing else before the DNS
pretty name, icon, chassis, deployment, location /etc/machine-info
time zone the /etc/localtime link, with export TZ=':/etc/localtime' in /etc/profile.d/20-timezone.sh
Wi-Fi country, which follows the zone /etc/modprobe.d/kdos-regdom.conf
network time on or off the /etc/service.disabled/chrony marker
locale /etc/locale.conf, which SDDM puts into every session
console keymap /etc/keymap, loaded by kdos-getty, with a copy in /boot/efi/EFI/kdos/keymap for the initramfs’s passphrase prompt
graphical keyboard layout /etc/kdos/xkb.conf, never under /etc/X11, with the same layout in /etc/xdg/kxkbrc

Every method checks its arguments, then asks polkit under systemd’s own action ids, then writes; the pattern the root daemons share is in The shape they share.

The port is KDOS’s own C with no upstream source. build.sh compiles the daemon with the sources of libkbase and links basu and nothing else: no glib and no Qt, because everything a root daemon links is code running as root.

Why it is in KDOS

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

hostname1, timedate1 and locale1 on the system bus, written to the files KDOS keeps, for System Settings, the greeter and plasma-setup.

Sources

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

Dependencies

Depends on: basu, dbus, polkit.

Required by (1): 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-settingsd'

What kpkg does

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

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-settingsd
SRC=$SRC_ROOT/kdos-settingsd-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-settingsd "$PORT_SRC"/*.c "$LIBS"/libkbase/*.c \
	$(pkg-config --libs basu) $LDFLAGS

install -Dm755 kdos-settingsd "$PKG/usr/sbin/kdos-settingsd"
install -Dm644 "$PORT_SRC/kdos-settingsd.conf" \
	"$PKG/usr/share/dbus-1/system.d/kdos-settingsd.conf"
for _i in hostname1 timedate1 locale1; do
	install -Dm644 "$PORT_SRC/org.freedesktop.$_i.policy" \
		"$PKG/usr/share/polkit-1/actions/org.freedesktop.$_i.policy"
done

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

Other files in the port directory, read by build.sh: bus.h, hostname.c, kdos-settingsd.conf, locale.c, main.c, org.freedesktop.hostname1.policy, org.freedesktop.locale1.policy, org.freedesktop.timedate1.policy, settingsd.h, store.c, timedate.c.

Contents

Installed programs: kdos-settingsd.

Notes