From cbd9790d0f17ed9686749aa0467efdac75a601f5 Mon Sep 17 00:00:00 2001 From: Archipelago Date: Fri, 13 Nov 2026 17:24:57 +0300 Subject: [PATCH] Pass the repository URL into the build container as a file The mirror guard and the image mirrorlist run inside build-in-container.sh, where the host-side variable does not exist. Write /job/mirror.txt on the host and read it in the container. --- adapters/build-iso.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adapters/build-iso.sh b/adapters/build-iso.sh index 01c1122..915e129 100644 --- a/adapters/build-iso.sh +++ b/adapters/build-iso.sh @@ -49,6 +49,8 @@ toolroot="$work/tools/root.x86_64" mirror=${ARCHIPELAGO_MIRROR_URL:-'https://mirror.nw-sys.ru/archlinux/$repo/os/$arch'} [[ $mirror != *$'\n'* && $mirror != *$'\r'* ]] printf 'Server = %s\n' "$mirror" > "$toolroot/etc/pacman.d/mirrorlist" +# The container script writes the same value into the image; /job is this work dir. +printf '%s\n' "$mirror" > "$work/mirror.txt" cat > "$work/update.json" <<'PROFILE' @@UPDATE_PROFILE@@ PROFILE @@ -254,6 +256,7 @@ rm -f /job/core/etc/ssh/ssh_host_* /job/core/etc/.pwd.lock # internal build transport must never leak into the image, and a snapshot build # must not silently fall back to the rolling mirror - that is what broke updates # on already deployed hosts when the mirror pruned a pinned package. +mirror=$(cat /job/mirror.txt) case $mirror in 'https://mirror.nw-sys.ru/archlinux'*|'https://mirror.nw-sys.ru/archipelago/arch-repo-snapshot/'*) ;; *) echo "Installed-system repository must be mirror.nw-sys.ru, got: $mirror" >&2; exit 1 ;;