Desktops configure kmscon VTs in the finalizer (D-109 regression)

Published GNOME/KDE images pointed autovt@.service at getty@.service and carried no
/etc/kmscon/kmscon.conf, so logind-opened VTs (tty2+) ran getty: kmscon never served
a desktop VT although D-109 keeps it there.

The kmscon setup sat in a gnome-probe guard inside the Core-tree block of
build-iso.sh. That block only runs for the core profile, so the guard could never
be true for a Purpose build. Move the setup into gnome-finalize.sh and
kde-finalize.sh (which do run for Purpose builds), assert mesa, kmscon.conf and the
autovt alias, and drop the alias that pinned tty1 to getty.

Also remove the remaining dead gnome-probe branches from the Core-tree block and
the ARCHIPELAGO_TOOLBOX_PACKAGE probe injection that could never be used: the
layered path resolves Toolbx from the frozen Core package universe.

A unit test now asserts both desktop finalizers configure kmscon and that the Core
tree does not.
This commit is contained in:
Archipelago 2026-11-14 02:07:01 +03:00
parent 98e62ae2c6
commit beb96f4bd2
8 changed files with 76 additions and 47 deletions

View file

@ -36,10 +36,11 @@ offline. A locked sideload seed and offline installation verification remain wor
Late Core→GNOME transitions and preservation of administrator network/DM choices
require a separate transition adapter; the current finalize script is clean-install only.
For the private patched Toolbx trial, set `ARCHIPELAGO_TOOLBOX_PACKAGE` to the
checksum-recorded `toolbox-0.3-2.1-x86_64.pkg.tar.zst` from
`purposes/common/desktop/toolbox-package/`. The builder records its input identity,
checks name/version/architecture, signs it with the existing private lab signer and
explicitly selects `archipelago/toolbox`. Package ownership/MTREE remain intact.
This is not a general package override API or public trust policy. Omitting the
variable retains the stock package (whose digest-config issue is still present).
The patched Toolbx trial (`ARCHIPELAGO_TOOLBOX_PACKAGE`,
`toolbox-0.3-2.1-x86_64.pkg.tar.zst`) applied only to the monolithic `gnome-probe`
path. That injection lived inside the Core-only branch, so the layered Purpose
build never used it and the variable was silently ignored; it has been removed
rather than left as a no-op. The layered path resolves stock `extra/toolbox` from
the frozen Core package universe. The patched package can only re-enter through a
new common snapshot (see `LAYERED-GNOME.md`), and a custom package override API
remains unimplemented and is not a public trust policy.

View file

@ -54,8 +54,18 @@ The supplied Core's binary is intentionally retained; a changed installed CLI
requires a new Core build, not a hidden replacement by Purpose.
The old GNOME-only patched Toolbx package cannot be added to the Core's frozen
package universe after the fact. This path resolves Toolbx from that universe;
any required custom package must be included when preparing the common snapshot.
package universe after the fact. This path resolves Toolbx from that universe
(stock `extra/toolbox`); any required custom package must be included when
preparing the common snapshot. The legacy `ARCHIPELAGO_TOOLBOX_PACKAGE` probe
injection was removed: it lived in the Core-only branch, so the layered path could
never use it and the variable was silently ignored.
Console handling follows D-109: Core and Container Runner keep the plain kernel
console with `getty@tty1`, desktops ship mesa and their finalizers point the
`autovt@.service` alias at `kmsconvt@.service` with `/etc/kmscon/kmscon.conf`.
The finalizer owns it because the Core-tree block in `build-iso.sh` only runs for
the `core` profile. The earlier copy of that setup sat in a `gnome-probe` guard
inside that block, so published desktops had `autovt@` pointing at getty.
Evidence: `reused-core.commit`, `purpose-layer.commit`, `purpose-transaction.log`,
`composition.txt`, plus immutable Purpose `metadata/delta.json`. Unit checks cover

View file

@ -26,8 +26,15 @@ whose `[Theme] Current=` reset the selection. Both files were confirmed in image
The corrected `zz-` name sorts after that file; finalization now checks the merged
vendor and `/etc` configuration instead of grepping only our fragment.
`sddm --example-config` wipes configuration to compiled defaults and is unsuitable
for this check. This source correction still requires a new pipeline publication
and the user's hardware verification; the published image remains affected.
for this check. That defect and its image are superseded by D-110, which removed
SDDM from the Purpose entirely; the corrected path is published as of run
`20261113T200705Z` and still awaits the user's hardware verification.
Console handling follows D-109: the Plasma greeter owns tty1, and finalization
points the `autovt@.service` alias at `kmsconvt@.service` and installs
`/etc/kmscon/kmscon.conf`, so logind-opened VTs (tty2+) run kmscon. It is asserted
in the finalizer (with a mesa presence check) because the Core-tree block in
`build-iso.sh` does not run for Purpose builds.
`archipelago build iso --purpose kde WORK BOOTSTRAP` renders the same private
Core-reuse/composition path as GNOME, inserting KDE assets before finalization.

View file

@ -96,10 +96,6 @@ if [[ $profile == gnome-probe ]]; then
cat > "$work/flatpak-import.sh" <<'ARCHIPELAGO_FLATPAK_IMPORT_SCRIPT'
@@FLATPAK_IMPORT@@
ARCHIPELAGO_FLATPAK_IMPORT_SCRIPT
if [[ -n ${ARCHIPELAGO_TOOLBOX_PACKAGE:-} ]]; then
cp "$ARCHIPELAGO_TOOLBOX_PACKAGE" "$work/toolbox-probe.pkg.tar.zst"
sha256sum "$work/toolbox-probe.pkg.tar.zst" > "$work/toolbox-package-input.sha256"
fi
cat > "$work/gnome-packages.txt" <<'PACKAGES'
# GNOME_PACKAGE_LIST
PACKAGES
@ -165,18 +161,7 @@ sed -i '/\[options\]/a HookDir = /job/core/etc/pacman.d/hooks' /job/core-pacman.
# Same-version local packages can have different per-run lab signatures.
# Prefer this run's exact archive/signature pair over the shared upstream cache.
sed -i '/\[options\]/a CacheDir = /job/private-package-cache\nCacheDir = /var/cache/pacman/pkg' /job/core-pacman.conf
desktop_packages=()
if [[ $ARCHIPELAGO_BUILD_PROFILE == gnome-probe ]]; then
mapfile -t desktop_packages < /job/gnome-packages.txt
if [[ -f /job/toolbox-probe.pkg.tar.zst ]]; then
for index in "${!desktop_packages[@]}"; do
if [[ ${desktop_packages[$index]} == toolbox ]]; then
desktop_packages[$index]=archipelago/toolbox
fi
done
fi
fi
pacstrap -C /job/core-pacman.conf -c -G -M /job/core base linux linux-firmware linux-firmware-amd linux-firmware-amdgpu linux-firmware-atheros linux-firmware-broadcom linux-firmware-cirrus linux-firmware-intel linux-firmware-liquidio linux-firmware-marvell linux-firmware-mediatek linux-firmware-mellanox linux-firmware-nfp linux-firmware-nvidia linux-firmware-other linux-firmware-qcom linux-firmware-qlogic linux-firmware-radeon linux-firmware-realtek linux-firmware-ti linux-firmware-whence x11-ssh-askpass usb_modeswitch archipelago kmscon terminus-font "${desktop_packages[@]}" 2>&1 | tee /job/evidence/core-transaction.log
pacstrap -C /job/core-pacman.conf -c -G -M /job/core base linux linux-firmware linux-firmware-amd linux-firmware-amdgpu linux-firmware-atheros linux-firmware-broadcom linux-firmware-cirrus linux-firmware-intel linux-firmware-liquidio linux-firmware-marvell linux-firmware-mediatek linux-firmware-mellanox linux-firmware-nfp linux-firmware-nvidia linux-firmware-other linux-firmware-qcom linux-firmware-qlogic linux-firmware-radeon linux-firmware-realtek linux-firmware-ti linux-firmware-whence x11-ssh-askpass usb_modeswitch archipelago kmscon terminus-font 2>&1 | tee /job/evidence/core-transaction.log
if grep -Ei 'error:|==> ERROR:' /job/evidence/core-transaction.log; then
echo 'Required Core transaction action failed' >&2; exit 1
fi
@ -194,9 +179,6 @@ printf '%s\n' "$snapshot" > /job/core/usr/lib/archipelago/snapshot
# Machine defaults are instantiated from the package, separate from package files.
rm -f /job/core/etc/os-release
cp /job/core/usr/lib/archipelago/defaults/os-release /job/core/etc/os-release
if [[ $ARCHIPELAGO_BUILD_PROFILE == gnome-probe ]]; then
cp /job/core/usr/lib/archipelago/defaults/os-release-gnome /job/core/etc/os-release
fi
printf 'archipelago\n' > /job/core/etc/hostname
cp /job/core/usr/lib/archipelago/defaults/{locale.conf,vconsole.conf} /job/core/etc/
ln -sfn /usr/share/zoneinfo/UTC /job/core/etc/localtime
@ -209,12 +191,7 @@ systemctl --root=/job/core enable systemd-networkd systemd-resolved systemd-time
# selects Terminus, and kmscon cannot start without mesa (every render engine
# needs libEGL/libgbm/libGLESv2, which the Arch package does not depend on). The
# packaged getty@tty1 drop-in runs the same onboarding wrapper as kmscon did.
if [[ $ARCHIPELAGO_BUILD_PROFILE == gnome-probe ]]; then
# Desktop purposes ship mesa, so kmscon can serve the VTs logind opens.
mkdir -p /job/core/etc/kmscon /job/core/etc/systemd/system
cp /job/core/usr/lib/archipelago/defaults/kmscon.conf /job/core/etc/kmscon/kmscon.conf
ln -sfn /usr/lib/systemd/system/kmsconvt@.service /job/core/etc/systemd/system/autovt@.service
fi
# Desktop purposes ship mesa; their finalizers add kmscon for logind VTs (D-109).
# Generate every locale supplied by glibc, including non-UTF-8 variants. This
# shared Core output is inherited by every Purpose; never borrow host locales.
sed -i -E 's/^#[[:space:]]*([a-z][a-z][a-z]?_[A-Z][A-Z][^[:space:]]*[[:space:]]+[^[:space:]#]+)[[:space:]]*$/\1/' /job/core/etc/locale.gen
@ -231,9 +208,6 @@ else
install -Dm0644 /job/core/usr/lib/locale/locale-archive "/archipelago-locale-cache/$locale_key"
fi
arch-chroot /job/core locale -a > /job/evidence/locales.txt
if [[ $ARCHIPELAGO_BUILD_PROFILE == gnome-probe ]]; then
@@GNOME_FINALIZE@@
fi
# Retain package hook inventory and source scripts for review, before any commit.
cp -a /job/core/usr/share/libalpm/hooks /job/evidence/hooks
find /job/core/var/lib/pacman/local -name install -exec cp --parents '{}' /job/evidence/ \;

View file

@ -1,5 +1,17 @@
# Initial clean GNOME integration profile only; not a generic rebase adapter.
systemctl --root=/job/core disable systemd-networkd archipelago-firstboot@tty1 archipelago-firstboot@ttyS0 getty@tty1 serial-getty@ttyS0 kmsconvt@tty1
# D-109: the display manager owns tty1, kmscon serves the VTs logind opens after
# it (Ctrl+Alt+F2...). Desktops ship mesa, which kmscon's render engines need at
# runtime, and the packaged OnFailure=getty@%i keeps a non-KMS fallback. The
# finalizer owns this because the Purpose build never runs the Core-tree block.
test -f /job/core/usr/lib/libEGL.so.1
install -Dm644 /job/core/usr/lib/archipelago/defaults/kmscon.conf /job/core/etc/kmscon/kmscon.conf
mkdir -p /job/core/etc/systemd/system
ln -sfn /usr/lib/systemd/system/kmsconvt@.service /job/core/etc/systemd/system/autovt@.service
rm -f /job/core/etc/systemd/system/autovt@tty1.service
test "$(readlink /job/core/etc/systemd/system/autovt@.service)" = /usr/lib/systemd/system/kmsconvt@.service
test ! -e /job/core/etc/systemd/system/autovt@tty1.service
test ! -e /job/core/etc/systemd/system/kmsconvt@tty1.service
systemctl --root=/job/core enable NetworkManager gdm bluetooth cups.socket power-profiles-daemon switcheroo-control \
archipelago-gnome-onboarding.timer
systemctl --root=/job/core set-default graphical.target

View file

@ -1,5 +1,17 @@
# Clean Core + KDE composition; existing-machine rebase is a separate workflow.
systemctl --root=/job/core disable systemd-networkd archipelago-firstboot@tty1 archipelago-firstboot@ttyS0 getty@tty1 serial-getty@ttyS0 kmsconvt@tty1
# D-109: the Plasma greeter owns tty1, kmscon serves the VTs logind opens after
# it (Ctrl+Alt+F2...). Desktops ship mesa, which kmscon's render engines need at
# runtime, and the packaged OnFailure=getty@%i keeps a non-KMS fallback. The
# finalizer owns this because the Purpose build never runs the Core-tree block.
test -f /job/core/usr/lib/libEGL.so.1
install -Dm644 /job/core/usr/lib/archipelago/defaults/kmscon.conf /job/core/etc/kmscon/kmscon.conf
mkdir -p /job/core/etc/systemd/system
ln -sfn /usr/lib/systemd/system/kmsconvt@.service /job/core/etc/systemd/system/autovt@.service
rm -f /job/core/etc/systemd/system/autovt@tty1.service
test "$(readlink /job/core/etc/systemd/system/autovt@.service)" = /usr/lib/systemd/system/kmsconvt@.service
test ! -e /job/core/etc/systemd/system/autovt@tty1.service
test ! -e /job/core/etc/systemd/system/kmsconvt@tty1.service
systemctl --root=/job/core enable NetworkManager ModemManager plasmalogin plasma-setup bluetooth cups.socket power-profiles-daemon \
archipelago-kde-onboarding.timer archipelago-software-refresh.timer
systemctl --root=/job/core set-default graphical.target

View file

@ -244,14 +244,8 @@ if [[ -f /job/plasma-setup.pkg.tar.zst ]]; then
cp /job/plasma-setup.pkg.tar.zst /job/package-repo/plasma-setup-6.8.2-1-x86_64.pkg.tar.zst
cp /job/plasma-setup-input.sha256 /job/evidence/
fi
if [[ ${ARCHIPELAGO_BUILD_PROFILE:-core} == gnome-probe && -f /job/toolbox-probe.pkg.tar.zst ]]; then
bsdtar -xOf /job/toolbox-probe.pkg.tar.zst .PKGINFO > /job/evidence/toolbox-probe.PKGINFO
grep -qx 'pkgname = toolbox' /job/evidence/toolbox-probe.PKGINFO
grep -qx 'pkgver = 0.3-2.1' /job/evidence/toolbox-probe.PKGINFO
grep -qx 'arch = x86_64' /job/evidence/toolbox-probe.PKGINFO
cp /job/toolbox-probe.pkg.tar.zst /job/package-repo/toolbox-0.3-2.1-x86_64.pkg.tar.zst
cp /job/toolbox-package-input.sha256 /job/evidence/
fi
# Toolbx comes from the frozen Core package universe in the layered path, so no
# probe package is injected here (see builder/LAYERED-GNOME.md).
bsdtar -xOf /job/package-repo/archipelago-*.pkg.tar.zst .MTREE | gzip -d > /job/evidence/archipelago.mtree
awk '{ for (i=1; i<=NF; i++) if ($i ~ /^time=/ && $i != "time=0.0" && $i != "time=0") exit 1 }' /job/evidence/archipelago.mtree
export GNUPGHOME=/etc/pacman.d/gnupg

View file

@ -106,4 +106,23 @@ mod tests {
assert!(child.wait().unwrap().success());
}
}
/// D-109: only the desktop finalizers configure kmscon, because only GNOME/KDE
/// ship mesa. A silent removal here left published desktops on getty for every
/// logind VT, so the invariant is asserted against the adapters directly.
#[test]
fn desktop_finalizers_configure_kmscon_vts() {
for finalizer in [include_str!("../adapters/gnome-finalize.sh"),
include_str!("../adapters/kde-finalize.sh")] {
assert!(finalizer.contains("test -f /job/core/usr/lib/libEGL.so.1"));
assert!(finalizer.contains("/job/core/etc/kmscon/kmscon.conf"));
assert!(finalizer.contains(
"ln -sfn /usr/lib/systemd/system/kmsconvt@.service /job/core/etc/systemd/system/autovt@.service"));
}
let core_tree = include_str!("../adapters/build-iso.sh");
assert!(!core_tree.contains("kmscon.conf"),
"the Core tree must keep the plain kernel console; desktops configure kmscon");
assert!(!core_tree.contains("kmsconvt@.service"),
"the Core tree must not alias autovt@ to kmscon");
}
}