aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index a1f1498..40a9be2 100755
--- a/build.sh
+++ b/build.sh
@@ -161,6 +161,25 @@ Server = https://github.com/archzfs/archzfs/releases/download/experimental
SigLevel = Never
EOF
+# Route pacstrap through a local pacoloco caching proxy when one is
+# running on localhost:9129. Pacoloco proxies Arch core/extra and the
+# archzfs GitHub-releases URL, caching successful fetches and serving
+# them on subsequent builds. Catches the recurring archzfs corruption
+# class — pacoloco re-fetches when a hashed file misses, and once a
+# good copy lands it stays good. Falls back to direct upstream when
+# pacoloco isn't listening so builds work on machines without the
+# optional proxy installed. See README "Build Host Requirements" for
+# the install steps.
+if (echo > /dev/tcp/localhost/9129) 2>/dev/null; then
+ info "Routing pacstrap through pacoloco at localhost:9129..."
+ sed -i 's|^Include = /etc/pacman.d/mirrorlist|Server = http://localhost:9129/repo/archlinux/$repo/os/$arch|' \
+ "$PROFILE_DIR/pacman.conf"
+ sed -i 's|^Server = https://github.com/archzfs/archzfs/releases/download/experimental$|Server = http://localhost:9129/repo/archzfs|' \
+ "$PROFILE_DIR/pacman.conf"
+else
+ info "pacoloco not detected — using upstream mirrors directly"
+fi
+
# Add ZFS and our custom packages
info "Adding ZFS and custom packages..."
cat >> "$PROFILE_DIR/packages.x86_64" << 'EOF'