From ecce1db026b3aea9b5311ff76b7d098205054ab5 Mon Sep 17 00:00:00 2001 From: tobias Date: Mon, 6 Jul 2026 22:02:11 +0200 Subject: [PATCH] Auto pull german mirrors before install --- 01-install/05-mirrors.sh | 16 ++++++++++++++++ 01-install/run.sh | 1 + 2 files changed, 17 insertions(+) create mode 100644 01-install/05-mirrors.sh diff --git a/01-install/05-mirrors.sh b/01-install/05-mirrors.sh new file mode 100644 index 0000000..801c01a --- /dev/null +++ b/01-install/05-mirrors.sh @@ -0,0 +1,16 @@ +# Rank download mirrors before pacstrap — WITHOUT reflector (not on the ISO). +# Pull a Germany/HTTPS list from Arch's official mirrorlist generator, already +# ordered by mirror status/score, and activate it. Only needs curl (on the ISO) +# and hits archlinux.org's CDN, so it doesn't depend on the slow current mirror. +# pacstrap copies this list into the installed system, so it speeds up the base +# install AND every later pacman run. Falls back to the shipped list on failure. +url='https://archlinux.org/mirrorlist/?country=DE&protocol=https&ip_version=4&use_mirror_status=on' +tmp="$(mktemp)" +if curl -fsS --max-time 20 "$url" -o "$tmp" && grep -q '^#Server' "$tmp"; then + cp -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak 2>/dev/null || true + sed 's/^#Server/Server/' "$tmp" > /etc/pacman.d/mirrorlist + info "mirrorlist → Germany/https, $(grep -c '^Server' /etc/pacman.d/mirrorlist) mirrors (status-ranked)" +else + info "could not fetch DE mirrorlist — keeping the ISO's list" +fi +rm -f "$tmp" diff --git a/01-install/run.sh b/01-install/run.sh index ca91748..f4dd272 100755 --- a/01-install/run.sh +++ b/01-install/run.sh @@ -24,6 +24,7 @@ read -rp "Type ERASE to continue: " ans [ "$ans" = ERASE ] || die "aborted" source ./00-partition.sh # partitions + mounts /mnt, /mnt/boot +source ./05-mirrors.sh # rank pacman mirrors (fast DE) before pacstrap source ./10-pacstrap.sh # base system + fstab + copy repo to /mnt/root # in-chroot steps (the whole repo, incl. system.conf, was copied by 10-pacstrap)