diff --git a/archiso/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook b/archiso/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook index 342aa95..e3167cc 100644 --- a/archiso/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook +++ b/archiso/airootfs/etc/pacman.d/hooks/uncomment-mirrors.hook @@ -6,8 +6,8 @@ Type = Package Target = pacman-mirrorlist [Action] -Description = Uncommenting all mirrors in /etc/pacman.d/mirrorlist... +Description = Uncommenting HTTPS mirrors in /etc/pacman.d/mirrorlist... When = PostTransaction Depends = pacman-mirrorlist Depends = sed -Exec = /usr/bin/sed -i "s/#Server/Server/g" /etc/pacman.d/mirrorlist +Exec = /usr/bin/sed -E -i 's/#(Server = https:)/\1/g' /etc/pacman.d/mirrorlist diff --git a/archiso/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf b/archiso/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf index b10ceb2..7d33577 100644 --- a/archiso/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf +++ b/archiso/airootfs/etc/systemd/system/getty@tty1.service.d/autologin.conf @@ -1,3 +1,3 @@ [Service] ExecStart= -ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin liveuser - $TERM +ExecStart=-/usr/bin/agetty --noreset --noclear --autologin liveuser - ${TERM} diff --git a/archiso/airootfs/root/.automated_script.sh b/archiso/airootfs/root/.automated_script.sh index b67686f..f24d2e2 100755 --- a/archiso/airootfs/root/.automated_script.sh +++ b/archiso/airootfs/root/.automated_script.sh @@ -17,13 +17,12 @@ automated_script() { script="$(script_cmdline)" if [[ -n "${script}" && ! -x /tmp/startup_script ]]; then if [[ "${script}" =~ ^((http|https|ftp|tftp)://) ]]; then - # there's no synchronization for network availability before executing this script - printf '%s: waiting for network-online.target\n' "$0" - until systemctl --quiet is-active network-online.target; do - sleep 1 - done printf '%s: downloading %s\n' "$0" "${script}" - curl "${script}" --location --retry-connrefused --retry 10 -s -o /tmp/startup_script + # there's no synchronization for network availability before executing this script; to ensure the network + # is online, we use a transient systemd service that depends on network-online.target to download the + # script rather than manually polling the target + systemd-run --pty --quiet -p Wants=network-online.target -p After=network-online.target \ + curl "${script}" --location --retry-connrefused --retry 10 --fail -s -o /tmp/startup_script rt=$? else cp "${script}" /tmp/startup_script @@ -42,4 +41,3 @@ automated_script() { if [[ $(tty) == "/dev/tty1" ]]; then automated_script fi -