builder/adapters/kde-finalize.sh
Archipelago 666cb76403 Package the distributor icons and refresh the hicolor cache (D-112)
package.sh now writes archipelago.svg and archipelago-symbolic.svg from tokens
rendered by builder::lib, so every edition ships the identity used by Discover
and GNOME Software. Both desktop finalizers run gtk-update-icon-cache after the
icon is in place.
2026-11-14 13:14:46 +03:00

72 lines
4.8 KiB
Bash

# 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
# Plasma Login Manager (fork of SDDM) owns the greeter. Its unit carries the
# display-manager alias, and the greeter is a Plasma session, so there are no
# SDDM themes or CompositorCommand knobs to configure.
test -x /job/core/usr/bin/plasmalogin
test -f /job/core/usr/lib/systemd/system/plasmalogin.service
arch-chroot /job/core pacman --config /dev/null --dbpath /usr/lib/archipelago/package-db -Q plasma-login-manager
arch-chroot /job/core pacman --config /dev/null --dbpath /usr/lib/archipelago/package-db -Q kinfocenter
arch-chroot /job/core pacman --config /dev/null --dbpath /usr/lib/archipelago/package-db -Q sddm >/dev/null 2>&1 && {
echo 'D-110: SDDM must not be installed in the KDE Purpose' >&2; exit 1; }
# Keyboard layouts and the virtual keyboard reach the greeter through the
# system-wide Plasma configuration that both the greeter and user sessions read.
# The greeter is a Plasma session and inherits these system-wide settings. They
# are machine defaults written here, not package payload: a package that installs
# files under /etc breaks the purpose composition (D-110 follow-up).
mkdir -p /job/core/etc/xdg
cat > /job/core/etc/xdg/kxkbrc <<'KXKBRC'
[Layout]
Use=true
LayoutList=ru,us
Model=pc105
Options=grp:alt_shift_toggle
KXKBRC
cat > /job/core/etc/xdg/plasmakeyboardrc <<'PLASMAKEYBOARD'
[General]
enabledLocales=ru_RU,en_US
PLASMAKEYBOARD
grep -qx 'LayoutList=ru,us' /job/core/etc/xdg/kxkbrc
grep -qx 'enabledLocales=ru_RU,en_US' /job/core/etc/xdg/plasmakeyboardrc
printf 'Plasma Login Manager: greeter is a Plasma session; kxkbrc/plasmakeyboardrc apply system-wide\n'
mkdir -p /job/core/etc/NetworkManager/conf.d /job/core/etc/sudoers.d /job/core/etc/containers /job/core/etc/archipelago
printf '[main]\ndns=systemd-resolved\n' > /job/core/etc/NetworkManager/conf.d/20-archipelago.conf
printf '%%wheel ALL=(ALL:ALL) ALL\n' > /job/core/etc/sudoers.d/10-archipelago-wheel
chmod 0440 /job/core/etc/sudoers.d/10-archipelago-wheel
# visudo needs the invoking uid in the chroot passwd database; the purpose stage
# is a package tree, not a booted system, so validate the fragment statically.
test "$(stat -c '%a' /job/core/etc/sudoers.d/10-archipelago-wheel)" = "440"
test "$(cat /job/core/etc/sudoers.d/10-archipelago-wheel)" = '%wheel ALL=(ALL:ALL) ALL'
mkdir -p /job/core/etc/plymouth
printf '[Daemon]\nTheme=spinner\n' > /job/core/etc/plymouth/plymouthd.conf
test -f /job/core/usr/share/plymouth/themes/spinner/spinner.plymouth
test ! -e /job/core/etc/plasma-setup-done
cp /job/core/usr/share/archipelago/desktop/toolbox.conf /job/core/etc/containers/toolbox.conf
install -Dm644 /job/core/usr/share/archipelago/desktop/toolbox-registries.conf /job/core/etc/containers/registries.conf.d/60-archipelago-toolbox.conf
arch-chroot /job/core glib-compile-schemas /usr/share/glib-2.0/schemas
arch-chroot /job/core update-desktop-database /usr/share/applications
arch-chroot /job/core update-mime-database /usr/share/mime
# Publish the packaged distributor icon to the shared hicolor cache.
arch-chroot /job/core gtk-update-icon-cache -f -t /usr/share/icons/hicolor
mkdir -p /job/core/etc/systemd/system
# D-095: stock Discover plus native OS/Flatpak backends, no PackageKit packages.
arch-chroot /job/core pacman --config /dev/null --dbpath /usr/lib/archipelago/package-db -Qq > /job/evidence/desktop-package-names.txt
if grep -Ei '^(packagekit($|-)|libpackagekit)' /job/evidence/desktop-package-names.txt; then
echo 'D-095: PackageKit is excluded from Desktop images' >&2
exit 1
fi