358.12. kcm-kdos-health-1.0.0
Health page of Info Center and System Settings, and the KDOS rows of About this System
| Version | 1.0.0, release 1 |
| Source tree | src/desktop/kcm-kdos-health/ |
| Phase | 50_desktop (Desktop), 67 of 92 in build order |
| Licence | MIT |
| Homepage | https://github.com/kunaldawn/kdos |
| Build time | 0.1 SBU |
| Installed size | 122.2 KiB in 8 files |
| Recipe | src/desktop/kcm-kdos-health/kpkgbuild |
About
kcm-kdos-health is the Health page, listed in Info Center beside About this System and under System in System Settings, and the six KDOS rows of About this System itself. The page runs kdos doctor --json and shows one row per check under doctor’s own section headings: passed, not checked on this machine, or needing attention, the last in the negative colour and named “Needs attention” to a screen reader. Check Again runs doctor again, Copy to Clipboard copies the report as kdos doctor prints it, and a filter narrows the rows. It changes nothing, so it has no Apply.
The rows of About this System are six POSIX shell scripts installed in /usr/libexec/kdos:
| Script | Row |
|---|---|
about-slot |
the A/B slot, its version and state, from /run/kdos/slot.json; the slot alone from the boot entry’s kdos_slot= when that file is absent; Live medium when neither names a slot and the root is an overlay |
about-update |
the key that verified the last update offered, and when, from /var/lib/kdos/update.json |
about-tree |
the commit and date of /ports, from its TREE stamp |
about-accent |
the KDOS accent, and the login screen’s when it differs |
about-libc |
musl’s version, from kpkg’s record |
about-boxes |
how many box profiles this user has |
Each prints its label ending in a colon, since Info Center shows the label verbatim beside its own rows, which end in one. The list that names them is /usr/share/kdos/xdg/kcm-about-distrorc, shipped under fs/. The port is KDOS’s own code with no upstream source, built with CMake against KF6 KCMUtils.
Why it is in KDOS
The comment above the 5 ports from kcm-kdos-system to kcm-kdos-health in script/phases/50_desktop/packages.txt:
System Settings pages: the A/B slots, boxes, the firewall's named services, the KDOS look and Phosphor mode, and the Health page.
Sources
None: the port builds from its own directory, /kdos/src/desktop/kcm-kdos-health.
Dependencies
Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtdeclarative, kcoreaddons, ki18n, kcmutils, kirigami, kdos-tools.
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 kcm-kdos-health'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /kdos/src/desktop/kcm-kdos-health.
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/kcm-kdos-health
SRC=$SRC_ROOT/kcm-kdos-health-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 KDE_INSTALL_LIBEXECDIR=libexec \
-D CMAKE_BUILD_TYPE=Release \
-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
-D BUILD_TESTING=OFF \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
The switches, and why each is set:
-D KDE_INSTALL_LIBEXECDIR=libexec— Put the about scripts in/usr/libexec/kdos, the pathskcm-about-distrorcnames. ECM’s default for this tree’s layout islib/libexec, where About this System would find none of them.-D BUILD_TESTING=OFF— Build no tests into the package.testing/plasmatest.shrunshealthtestagainsttests/fake-doctor, andtesting/selftest.shrunstests/aboutrows.shon a bare host.
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/kcm-kdos-health, 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 kcm-kdos-health-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/kcm-kdos-health, and runs the triggers its paths call for.
Other files in the port directory, read by build.sh: CMakeLists.txt, about/, doctormodel.cpp, doctormodel.h, healthcontroller.cpp, healthcontroller.h, healthkcm.cpp, kcm_kdos_health.json, tests/, ui/.
Notes
kinfocenter runs every script ExtraSoftwareData names twice, on the GUI thread, and ends System Settings when one prints fewer than two lines. So each script prints a label and a value on every machine and on every error, Unknown when it knows nothing, reads only small state files and never asks podman, the ESP or the network, and sets its own PATH. A script named in kcm-about-distrorc that this package does not install would print nothing, so the two change together. tests/aboutrows.sh checks every row with no environment, in the English pass, on a root with no state at all, with a read-only /var and with state files written to break it, and checks that the shipped list names exactly the six scripts.
about-update reads update.json as the one line of JSON kdos update check writes and takes the key and the time from the top-level signed_by and verified fields only. A quote inside a JSON string is always escaped, so release notes or a signer’s name holding the same words cannot stand in for them; a key that is not 16 hex digits is not shown.
kinfocenter’s own command-output pages use CommandOutputContext, which is kinfocenter’s private library: it installs no header and says it may not be linked to, and its plain text cannot mark a failed check as one. The page keeps its shape (a program and its arguments, ready, error and explanation, a filter, refresh) and reads doctor’s JSON records instead. Doctor exits 1 when a check warned, which is a report like any other; only another exit status, output that is not a report, or a kdos that cannot be started is shown as an error.