aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-25 16:04:15 -0400
committerCraig Jennings <c@cjennings.net>2026-06-25 16:04:15 -0400
commit8f32ec75fde2868f27d04eac3e0a374910ed8701 (patch)
treedad011a2d025e8a797a649cb945bcd5d0414d8f0
parent0acba60b9e9f0ef9b53bee2dbb651d010fe7083e (diff)
downloadarchsetup-8f32ec75fde2868f27d04eac3e0a374910ed8701.tar.gz
archsetup-8f32ec75fde2868f27d04eac3e0a374910ed8701.zip
fix(archsetup): run reflector during install to avoid mirror stalls
The base image ships the full unsorted worldwide mirrorlist (hundreds of mirrors), and archsetup only configured reflector's timer, so the install ran every download against that list. pacman then stalled for many minutes on a slow or unresponsive mirror during the package installs. archsetup now runs reflector once before the heavy installs, curating a few fast recently-synced HTTPS mirrors and refreshing the databases against them. The run is bounded by `timeout` and non-fatal, so a flaky mirror-status service falls back to the base list instead of blocking the install. Surfaced by the ZFS VM test path, where a worldwide-list mirror stalled a full run at the ditaa/JRE download.
-rwxr-xr-xarchsetup15
1 files changed, 15 insertions, 0 deletions
diff --git a/archsetup b/archsetup
index ae87c3a..a7cce2c 100755
--- a/archsetup
+++ b/archsetup
@@ -990,6 +990,21 @@ prerequisites() {
--save /etc/pacman.d/mirrorlist
EOF
+ # Run reflector now, not only on the timer. The base image ships the full
+ # unsorted worldwide mirrorlist (hundreds of mirrors), so the heavy package
+ # installs below can stall for many minutes on a slow or unresponsive one.
+ # Curate to a few fast, recently-synced HTTPS mirrors up front, then refresh
+ # the databases against them. Bounded by `timeout` and non-fatal: reflector's
+ # own per-probe timeouts cap it, and the base list still works if it can't
+ # finish, so a flaky mirror-status service never blocks the install.
+ action="selecting fast mirrors (reflector)" && display "task" "$action"
+ backup_system_file /etc/pacman.d/mirrorlist
+ if timeout 120 reflector @/etc/xdg/reflector/reflector.conf >> "$logfile" 2>&1; then
+ pacman -Syy >> "$logfile" 2>&1 || error_warn "refreshing databases after reflector" "$?"
+ else
+ error_warn "selecting fast mirrors (reflector)" "$?"
+ fi
+
action="enabling the reflector timer" && display "task" "$action"
(systemctl enable reflector.timer >> "$logfile" 2>&1) || \
error_warn "$action" "$?"