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

354.25. plasma-setup-6.8.2

First-boot setup wizard — creates the first account and sets keyboard, time zone and network

The build-state snapshot was taken from 6.8.2-3; this recipe is 6.8.2-4, so the size, time and contents below describe the earlier build.

Version 6.8.2, release 4
Shelf kde — KDE Plasma and Gear platform pieces outside Frameworks that have no other domain: KIO workers, thumbnailers, Plasma integration, KDE Wayland glue
Phase 50_desktop (Desktop), 48 of 92 in build order
Licence LGPL-2.1-or-later AND GPL-2.0-or-later AND LGPL-2.0-or-later AND (LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL) AND GPL-3.0-or-later
Homepage https://invent.kde.org/plasma/plasma-setup
Build time 0.2 SBU
Installed size 1.8 MiB in 97 files
Recipe ports/core/kde/plasma-setup/kpkgbuild

About

Plasma Setup is the first-boot wizard for a machine handed over without an account: the installer’s “Let the first person to start it set it up (OEM)” choice. On that machine’s first boot the login manager signs in a special plasma-setup user with no password, whose session runs only the wizard. The wizard:

Why it is in KDOS

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

The first-boot wizard that creates the first account.

Sources

Dependencies

Depends on: cmake, ninja, extra-cmake-modules, pkgconf, qt6-qtbase, qt6-qtdeclarative, qt6-qtsvg, kauth, kcoreaddons, ki18n, kpackage, kconfig, kirigami, kirigami-addons, kitemmodels, libkscreen, plasma-workspace, plasma-desktop, plasma-nm, plasma-keyboard, sddm, shadow.

Required by (1): kde-plasma.

Patches

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

plasmasetuprc-kdos-groups.patch sets [Accounts] UserGroups to the groups the image gives its own account in fs/etc/group (wheel,users,audio,video,render,input,kvm,cdrom,dialout,lpadmin,tty) instead of wheel alone. An OEM install’s first account is made by Plasma Setup’s helper with useradd -m -U, which gives it /etc/default/useradd’s GROUPS=audio, and then usermod -a -G with this list; an account made by the installer keeps the live account’s memberships, so the two would otherwise differ: without kvm a box gets no hardware virtualisation, without lpadmin the printer pages ask for an administrator. Every group named must exist in /etc/group, or useradd refuses the account; the list follows fs/etc/group’s kdos lines. It is not proposed upstream: the file is upstream’s documented place for a distribution’s choice.

plasma-setup-kdos-firstboot.patch changes the keyboard, landing, Account and Time pages; its code is to be offered upstream. Each change, and what upstream does instead:

Keyboard layout list order. The keyboard page’s two lists sort through a new LayoutVariantSortModel over upstream’s filters. The layout list sorts by description, A to Z, as the keyboard settings’ Add Layout dialog does, and while a search is applied by the fuzzy-match score, best match first, with equal scores by description. Every score is 0 before a search (an empty pattern matches everything at score 0), so the score gives no order until a search is applied, and the layout model’s own order is the XKB rules files’, which is not alphabetical (Armenian before Arabic, the extra layouts after Wolof). Upstream sorts by the score ascending, so a search for German lists plain German last.

Variant list order. The variant list puts the layout’s own row without a variant first, then the variants by description, and while a search is applied by match score, best first, with equal scores by description. Upstream sorts it by score ascending, so after a search for German the list opens on Romanian (Germany, no dead keys) with plain German last, and a click on the first row picks the wrong layout. The model’s searching property follows the search string the layout search model holds, which the field sets when Enter is pressed; its plainFirst property is set for the variant list alone.

Highlight follows the applied layout. After any re-sort or re-filter of either list, and after a click, both lists highlight the layout and variant in use (the system’s current layout, which a click replaces), scrolled into view, and nothing when a search hides that layout. A ListView keeps its row number across a re-sort or re-filter, so without this it would highlight whichever row moved into that position while a different layout stays applied; a click re-filters the variant list, so the plain German row would stay unhighlighted after German is clicked. Arrow keys still move the highlight without applying it, and the variant list of a layout reached that way highlights nothing.

Keyboard page text. The subtitle reads Select your keyboard layout., since the page has no language control, and the search field shows no Ctrl+F hover tooltip, since the page focuses the field itself and the tooltip would open over the subtitle.

Landing wallpaper. The landing page takes its background from the wallpaper package named by [Appearance] Wallpaper in plasmasetuprc (default Next): of the images named WxH in the screen’s orientation, the one with the longest short side, from images_dark first when the active colour scheme’s window background is dark by Kirigami’s ColorUtils.brightnessForColor. Upstream asks the Dark Theme page’s PrepareUtil.usingDarkTheme, which is true only for the scheme named BreezeDark, so every KDOS scheme would show the light image behind the wizard’s headline; and it names Next’s own 5120x2880.png and 1440x2960.png, which no KDOS wallpaper carries.

Landing headline. The headline is [Appearance] Welcome when that key is set, instead of Welcome to Plasma Desktop. The headline and the Begin Setup button sit on a scrim, a rounded panel of the colour scheme’s window background at 85% opacity padded by twice Kirigami.Units.largeSpacing, and the headline takes the scheme’s text colour instead of white: white text over a wallpaper reads only where the image is dark, and the KDOS mascot’s light belly runs through the letters.

Account avatar. The Account page’s avatar is a plain kirigami-addons Avatar, a display element, in the colour scheme’s highlight colour (the accent), instead of upstream’s disabled AvatarButton in a colour hashed from the typed name that has nothing to do with the scheme. The colour has to be resolved outside a disabled button: AvatarButton takes the Button colour set, whose disabled highlight on a KDOS scheme is the window background, so the initials would vanish once a name is typed.

Time zone preselection. The Time page preselects the machine’s time zone only when the selector’s map shows it. A zone with no place on the map, such as UTC, raises the selector’s The currently selected time zone is not available for visualization on this map banner, and its location box then looks up a region the zone has none of and throws. Left unset, the region box reads Choose… and the machine keeps its zone until one is picked.

The same patch sets KDOS’s values in plasmasetuprc: Wallpaper=KDOS-Bone, the default accent’s wallpaper (an install in another accent still shows Bone’s here), and a Welcome= headline of Welcome to KDOS in the upstream headline’s two-line form. Those two lines are KDOS’s choice, not part of the offer.

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 plasma-setup'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/kde/plasma-setup.

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/kde/plasma-setup
echo 'd10c2d766e2b1a3afaa70c2995f0abc8eb9ff2da19c9a4e794ae9e89859758d7  plasma-setup-6.8.2.tar.xz' | 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/plasma-setup
SRC=$SRC_ROOT/plasma-setup-6.8.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf plasma-setup-6.8.2.tar.xz -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 recipe’s helpers group and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/plasmasetuprc-kdos-groups.patch"
patch -p1 -i "$PORT_SRC/plasma-setup-kdos-firstboot.patch"

cmake -S . -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D KDE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
	-D BUILD_TESTING=OFF \
	-D KF_SKIP_PO_PROCESSING=ON \
	-D KDE_INSTALL_CONFDIR=/usr/share/kdos/xdg \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
rm -rf "$PKG/usr/lib/systemd" "$PKG/usr/lib/sysusers.d" "$PKG/usr/lib/tmpfiles.d"
rm -rf "$PKG/usr/share/plasma/packages/org.kde.plasmasetup.language" "$PKG/usr/share/plasma/packages/org.kde.plasmasetup.prepare"

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/plasma-setup, 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 plasma-setup-6.8.2-4.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/plasma-setup, and runs the triggers its paths call for.

Contents

Installed libraries: libcomponentspluginplugin.a.

Installed directories: /usr/lib/qt6/qml/org/kde/plasmasetup, /usr/share/licenses/plasma-setup, /usr/share/plasma-setup, /usr/share/plasma/packages/org.kde.plasmasetup.account, /usr/share/plasma/packages/org.kde.plasmasetup.finished, /usr/share/plasma/packages/org.kde.plasmasetup.hostname, /usr/share/plasma/packages/org.kde.plasmasetup.keyboard, /usr/share/plasma/packages/org.kde.plasmasetup.time, /usr/share/plasma/packages/org.kde.plasmasetup.wifi.

Notes

build.sh removes two of the wizard’s pages, which are KPackages the wizard finds by listing /usr/share/plasma/packages: org.kde.plasmasetup.language, whose list holds the one language the image ships, and org.kde.plasmasetup.prepare (Before we get started), whose only control is a Dark Theme switch that applies the Breeze or Breeze Dark global theme over the KDOS accent. The prepareutil QML module that page used stays installed and is loaded by nothing. The wizard’s pages are Keyboard, Account, Host name, Time and Wi-Fi, then Finished.

Upstream arms the wizard with three systemd pieces, and build.sh deletes all three: plasma-setup.service under /usr/lib/systemd/system, the plasma-setup user in /usr/lib/sysusers.d, and the user’s home in /usr/lib/tmpfiles.d. KDOS has no systemd and kpkg’s package lint refuses usr/lib/systemd (see No systemd). Their work is done by a boot script instead, before the login manager starts and only while /etc/plasma-setup-done is absent and the system is not the live medium: it provides the plasma-setup account, builds its home in /run/plasma-setup (the autostart entry for the wizard, the global-shortcut allow-list from /usr/share/plasma-setup/kglobalaccelrc, and the settings that turn off the screen locker, the wallet, the welcome tour and the default panel), and runs plasma-setup-bootutil, which writes the autologin drop-in /etc/sddm.conf.d/99-plasma-setup.conf. The script is /etc/init.d/62_plasma-setup.sh; once /etc/plasma-setup-done exists it also deletes a leftover 99-plasma-setup.conf, so a wizard that finished without removing its autologin cannot log the plasma-setup account in again.

plasma-setup-bootutil asks systemd over the system bus whether Plasma Login Manager (plasmalogin.service) is enabled; with no systemd the call fails and it writes SDDM’s drop-in, which is the login manager KDOS runs (sddm).

The wizard’s privileged steps go through its KAuth helper, plasma-setup-auth-helper, which runs useradd, chpasswd and usermod from shadow, found in /usr/sbin. Its pages change the system through the hostname1, locale1 and timedate1 interfaces KDOS’s kdos-settingsd serves, and through NetworkManager. The polkit rule upstream installs, /usr/share/polkit-1/rules.d/plasma-setup-polkit.rules, lets the plasma-setup user take exactly those actions without a password, and nobody else. Accounts it creates join audio through useradd’s default and the groups in /usr/share/kdos/xdg/plasmasetuprc through usermod -a, and it reads the first ordinary UID from /etc/login.defs.

The keyboard page needs org.kde.plasma.private.kcm_keyboard from plasma-desktop at build time (ecm_find_qmlmodule(... REQUIRED)), and the Wi-Fi page loads plasma-nm’s QML at run time; the wizard’s session shows plasma-keyboard on a touch screen.