Skip to content

Commit 133128f

Browse files
Marketenclaude
andcommitted
Download the newest Debian point release from debian-cd
Debian only moves a point release into cdimage/archive once it has been superseded, so the archive URL 404s for the current release. That broke every automated base ISO bump (e.g. #727, debian-13.7.0). Try debian-cd first and fall back to the archive, and drop partial downloads so a failed attempt is not reused on the next build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 231f334 commit 133128f

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

‎iso/scripts/common_iso_generation.sh‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,32 @@ WORKDIR="/usr/src/app"
44
ISO_BUILD_PATH="${WORKDIR}/dappnode-iso"
55
DAPPNODE_ISO_PREFIX="Dappnode-"
66

7+
# Usage: download_iso <path> <name> <url> [fallback_url...]
8+
# URLs are tried in order, which covers mirrors that move older releases elsewhere.
79
download_iso() {
810
local iso_path=$1
911
local iso_name=$2
10-
local iso_url=$3
12+
shift 2
1113

1214
echo "[INFO] Downloading base ISO image: ${iso_name}..."
13-
if [ ! -f "${iso_path}" ]; then
14-
wget "${iso_url}" -O "${iso_path}"
15+
if [ -f "${iso_path}" ]; then
16+
echo "[INFO] Download complete!"
17+
return 0
1518
fi
16-
echo "[INFO] Download complete!"
19+
20+
local iso_url
21+
for iso_url in "$@"; do
22+
if wget "${iso_url}" -O "${iso_path}"; then
23+
echo "[INFO] Download complete!"
24+
return 0
25+
fi
26+
# wget leaves a partial file behind, which would be reused on the next run
27+
rm -f "${iso_path}"
28+
echo "[WARN] Could not download ${iso_url}"
29+
done
30+
31+
echo "[ERROR] Could not download ${iso_name} from any known location"
32+
exit 1
1733
}
1834

1935
verify_download() {

‎iso/scripts/generate_dappnode_iso_debian.sh‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ BASE_ISO_NAME="debian-13.5.0-amd64-netinst.iso"
1010
BASE_ISO_VERSION="${BASE_ISO_NAME#debian-}"
1111
BASE_ISO_VERSION="${BASE_ISO_VERSION%-amd64-netinst.iso}"
1212
BASE_ISO_PATH="/images/${BASE_ISO_NAME}"
13-
BASE_ISO_URL="https://cdimage.debian.org/mirror/cdimage/archive/${BASE_ISO_VERSION}/amd64/iso-cd/${BASE_ISO_NAME}"
13+
# Debian serves the newest point release from debian-cd/ and only moves it to the
14+
# archive once it is superseded, so try both.
15+
BASE_ISO_URL="https://cdimage.debian.org/debian-cd/${BASE_ISO_VERSION}/amd64/iso-cd/${BASE_ISO_NAME}"
16+
BASE_ISO_ARCHIVE_URL="https://cdimage.debian.org/mirror/cdimage/archive/${BASE_ISO_VERSION}/amd64/iso-cd/${BASE_ISO_NAME}"
1417
BASE_ISO_SHASUM="95838884f5ea6c82421dfe6baaa5a639dbbe6756c1e380f9fe7a7cb0c1949d2a ${BASE_ISO_PATH}"
1518

1619
DAPPNODE_ISO_NAME="${DAPPNODE_ISO_PREFIX}${BASE_ISO_NAME}"
@@ -98,7 +101,7 @@ generate_debian_iso() {
98101
-isohybrid-gpt-basdat -o "${iso_output_path}" ${iso_build_path}
99102
}
100103

101-
download_iso "${BASE_ISO_PATH}" "${BASE_ISO_NAME}" "${BASE_ISO_URL}"
104+
download_iso "${BASE_ISO_PATH}" "${BASE_ISO_NAME}" "${BASE_ISO_URL}" "${BASE_ISO_ARCHIVE_URL}"
102105
verify_download "${BASE_ISO_PATH}" "${BASE_ISO_SHASUM}"
103106
clean_old_files "${ISO_BUILD_PATH}" "${DAPPNODE_ISO_PREFIX}"
104107
extract_iso "${BASE_ISO_PATH}" "${ISO_BUILD_PATH}"

0 commit comments

Comments
 (0)