Validate the KDE sudoers fragment without the chroot passwd database

visudo needs the invoking uid in the chroot's account database; the purpose
stage is a package tree whose /etc is not guaranteed complete at that point.
Check the mode and content instead.
This commit is contained in:
Archipelago 2026-11-13 19:14:34 +03:00
parent 6fb235f6a0
commit 6e88fc914e

View file

@ -21,7 +21,10 @@ mkdir -p /job/core/etc/NetworkManager/conf.d /job/core/etc/sudoers.d /job/core/e
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
arch-chroot /job/core visudo -c
# 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