aboutsummaryrefslogtreecommitdiffstats
path: root/tools/create-image.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/create-image.sh')
-rwxr-xr-xtools/create-image.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/create-image.sh b/tools/create-image.sh
index d73b8eeb2..4d2b3458c 100755
--- a/tools/create-image.sh
+++ b/tools/create-image.sh
@@ -144,7 +144,16 @@ fi
if [ $DEBARCH == "riscv64" ]; then
DEBOOTSTRAP_PARAMS="--keyring /usr/share/keyrings/debian-ports-archive-keyring.gpg --exclude firmware-atheros $DEBOOTSTRAP_PARAMS http://deb.debian.org/debian-ports"
fi
-sudo --preserve-env=http_proxy,https_proxy,ftp_proxy,no_proxy debootstrap $DEBOOTSTRAP_PARAMS
+
+# debootstrap may fail for EoL Debian releases
+RET=0
+sudo --preserve-env=http_proxy,https_proxy,ftp_proxy,no_proxy debootstrap $DEBOOTSTRAP_PARAMS || RET=$?
+
+if [ $RET != 0 ] && [ $DEBARCH != "riscv64" ]; then
+ # Try running debootstrap again using the Debian archive
+ DEBOOTSTRAP_PARAMS="--keyring /usr/share/keyrings/debian-archive-removed-keys.gpg $DEBOOTSTRAP_PARAMS https://archive.debian.org/debian-archive/debian/"
+ sudo --preserve-env=http_proxy,https_proxy,ftp_proxy,no_proxy debootstrap $DEBOOTSTRAP_PARAMS
+fi
# 2. debootstrap stage: only necessary if target != host architecture