From 9f3d6992436fc9d321738646b5dbbed77c060e42 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 20 Aug 2025 16:41:51 +0200 Subject: [PATCH] Setup sudoless install in the autorstart instead --- builder/cmds/autostart.sh | 7 ++----- builder/online.sh | 5 ----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/builder/cmds/autostart.sh b/builder/cmds/autostart.sh index a3a1eb6..e465544 100644 --- a/builder/cmds/autostart.sh +++ b/builder/cmds/autostart.sh @@ -28,12 +28,9 @@ if [[ $(tty) == "/dev/tty1" ]]; then OMARCHY_USER="$(ls -1 /mnt/home | head -n1)" - # Copy sudoers config to target system for passwordless sudo in chroot + # No need to ask for sudo during the installation (omarchy itself responsible for removing after install) mkdir -p /mnt/etc/sudoers.d - cp /etc/sudoers.d/99-omarchy-installer /mnt/etc/sudoers.d/ - - # Also ensure the user can run sudo without password in chroot - echo "$OMARCHY_USER ALL=(ALL:ALL) NOPASSWD: ALL" >>/mnt/etc/sudoers.d/99-omarchy-installer + echo "root ALL=(ALL:ALL) NOPASSWD: ALL\n%wheel ALL=(ALL:ALL) NOPASSWD: ALL\n$OMARCHY_USER ALL=(ALL:ALL) NOPASSWD: ALL" >/mnt/etc/sudoers.d/99-omarchy-installer HOME=/home/$OMARCHY_USER \ arch-chroot -u $OMARCHY_USER /mnt/ \ diff --git a/builder/online.sh b/builder/online.sh index 15b94b0..cafab0f 100755 --- a/builder/online.sh +++ b/builder/online.sh @@ -24,11 +24,6 @@ rm "airootfs/etc/systemd/system/multi-user.target.wants/reflector.service" rm -rf "airootfs/etc/systemd/system/reflector.service.d" rm -rf "airootfs/etc/xdg/reflector" -# Configure sudoers for passwordless installation -# This allows the installer to run without password prompts -# mkdir -p "$cache_dir/airootfs/etc/sudoers.d" -# cp /builder/configs/sudo-less-installation "$cache_dir/airootfs/etc/sudoers.d/99-omarchy-installer" - # Ensure the Omarchy installer launches automatically on boot cp /builder/cmds/autostart.sh airootfs/root/.automated_script.sh