From 8710a9ebdb8c976c607ca90b3ae55ad081870595 Mon Sep 17 00:00:00 2001 From: echno Date: Fri, 7 Jun 2024 17:14:13 +0200 Subject: [PATCH] Update create-image.sh for EoL Debain releases --- guestimage/create-image.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/guestimage/create-image.sh b/guestimage/create-image.sh index 223e733..4c006fd 100755 --- a/guestimage/create-image.sh +++ b/guestimage/create-image.sh @@ -148,7 +148,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