358.21. kdos-installer-gui-1.0.0
Install KDOS — the graphical installer, a Kirigami front end over kinstall
| Version | 1.0.0, release 1 |
| Source tree | src/desktop/kdos-installer-gui/ |
| Phase | 50_desktop (Desktop), 76 of 92 in build order |
| Licence | MIT |
| Homepage | https://github.com/kunaldawn/kdos |
| Build time | 0.1 SBU |
| Installed size | 1.7 MiB in 4 files |
| Recipe | src/desktop/kdos-installer-gui/kpkgbuild |
About
kdos-installer-gui is the graphical installer, Install KDOS: a Kirigami window that walks through the pages Welcome (the time zone), Keyboard, Disk, Encryption, Account, Look, Applications and Summary, then installs and says how it ended.
It is a front end and nothing more:
- The machine is described to it by kinstall’s dumps (
kinstall --dump probe|look|apps|plan --json). - The install is
pkexec /usr/bin/kinstall --config - --unattended --events json, with the answers, the passwords among them, written to kinstall’s standard input and the progress read back as one JSON event per line. - The Summary page is kinstall’s own plan for the same answers, so what it shows is what runs, and answers kinstall would refuse are refused there.
The Disk page’s “Partition Manager…” opens Partition Manager and probes the disks again when it closes. One window runs per session: the program is unique on the session bus as io.kdos.kdos-installer-gui through KDBusAddons, and a second launch raises the first window.
The port is KDOS’s own code with no upstream source, C++ and QML built with CMake against Kirigami, KI18n, KConfig, KColorScheme, KItemModels, KDBusAddons and KIO; every program it starts is an argument vector given to QProcess, never a shell.
Why it is in KDOS
The comment above it in script/phases/50_desktop/packages.txt:
The graphical installer, a Kirigami front end over kinstall.
Sources
None: the port builds from its own directory, /kdos/src/desktop/kdos-installer-gui.
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtdeclarative, kcolorscheme, kconfig, kcoreaddons, kdbusaddons, ki18n, kio, kirigami, kitemmodels, qqc2-desktop-style, 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-installer-gui'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /kdos/src/desktop/kdos-installer-gui.
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-installer-gui
SRC=$SRC_ROOT/kdos-installer-gui-1.0.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:
cmake -S "$PORT_SRC" -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 KDOS_KINSTALL=/usr/bin/kinstall \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
The switches, and why each is set:
-D BUILD_TESTING=OFF— Build no tests into the package.testing/plasmatest.shconfigures the same sources with tests on:installertestreads the answer file the pages produce back as kinstall’skey = valuelines, replays event streams kinstall wrote (tests/fixtures) through the parser in pieces that cut lines, checks that a stream pkexec ended before any event reads as permission refused, parses a fixtureevdev.lstagainst a fixture symbols directory, writes the live session’skxkbrcfor German (no dead keys) into a temporary configuration directory, checks that aKConfigWatcheronkxkbrchears the change notice for its[Layout]keys, reads a fixturezone1970.tab, tells the live medium from two fixture mounts tables, checks that choosing a disk with no partitions turns to the erase plan, and checks the words naming a disk and what an erase destroys (an LVM physical volume partition by its group, neverLVM2_member).-D KDOS_KINSTALL=/usr/bin/kinstall— The binary the installer runs and the pkexec policyio.kdos.installer.runnames by itsexec.path. pkexec matches the path exactly, so it is compiled in and never looked up on$PATH; the two must name the same file.
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-installer-gui, 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-installer-gui-1.0.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-installer-gui, and runs the triggers its paths call for.
Other files in the port directory, read by build.sh: 49-kdos-installer-live.rules, CMakeLists.txt, answers.cpp, answers.h, backend.cpp, backend.h, eventstream.cpp, eventstream.h, io.kdos.installer.policy, kdos-installer.desktop, keyboardmodel.cpp, keyboardmodel.h, main.cpp, qml/, tests/.
Contents
Installed programs: kdos-installer-gui.
Installed directories: /usr/share/kdos/installer.
Notes
The port installs its desktop entry and the live medium’s polkit rule under /usr/share/kdos/installer, where nothing reads them, and the policy under /usr/share/polkit-1/actions. On the live medium the boot step /etc/init.d/63_live-installer.sh copies the entry into /usr/share/applications and onto the live account’s desktop, and the rule, which grants the install and kpmcore’s helper to the local active session with no password, into /etc/polkit-1/rules.d; kinstall leaves all of them out of the copy. An installed machine therefore offers no “Install KDOS” entry, and running the program there asks for an administrator’s password. The welcome tour’s live page opens the same entry: the live medium’s plasma-welcomerc names LiveInstaller=kdos-installer.
kinstall is not in depends because it is on every tree before this port builds: 10_bootstrap/130_kinstall.sh cross-compiles it into every tree from the first bootable one, and the kdos-installer port that 41_system builds from the same sources adopts that file.
On the live medium (a root that is an overlay) the first probe, Look Again and the Summary’s plan run pkexec /usr/bin/kinstall --config - --dump probe|plan --json under io.kdos.installer.run: only a root probe activates the LVM groups the live boot leaves inactive, and only a root plan sees an inactive volume group named kdos on another disk, which the install refuses. The Disk page’s swap check runs the plan as the user, and Next waits for it. The user’s payload walk cannot enter what only root may and measures less than root’s, so the last root probe’s payload_kb and appbox_kb are given (--payload-kb, --appbox-kb) to every plan and to every probe as the user, and the Disk page and the Summary advise the same swap size. A root probe is given none and measures again, so Look Again takes in a tree that has grown. A probe asked for while the first root probe runs waits for it rather than replacing it, so its payload is kept; until one is kept, the Disk page’s swap check runs as root too. A root dump superseded by a newer one is detached rather than killed: the user cannot signal it, and destroying its QProcess would block the window until it ended. Open the Log hands the log to KIO’s OpenUrlJob as text/plain, so it opens in the text editor and never in whatever claims the file’s extension.
On the live medium the Keyboard page’s choice is applied to the live session as well (Backend::applyLiveLayout): ~/.config/kxkbrc’s [Layout] lists the layout with us second, written through KConfig, then KConfig’s change notice for it (ConfigChanged on /kxkbrc, interface org.kde.kconfig.notify, naming LayoutList, VariantList and Use in [Layout]). KWin loads the layout list again only from that notice, through its KConfigWatcher; a file written without it changes nothing, and KConfig sends none itself for a file opened by its absolute path. fcitx5 is left alone: with its XKB override off (/etc/xdg/fcitx5/conf/wayland.conf) it decodes keys with the keymap KWin hands it. Without this, the passwords typed on the Encryption and Account pages would be typed on the live medium’s US keys and differ from what the installed greeter receives.
A password or passphrase that starts or ends with a space is refused on its page, because kinstall’s answer-file parser trims the ends of every value; a line break cannot be typed into a field and is flattened if one arrives anyway, so a value can never become a second key.