From 902984c8cdf1f51a7f2501417b36384510ad9050 Mon Sep 17 00:00:00 2001 From: Marketen Date: Thu, 8 Oct 2026 13:45:32 +0200 Subject: [PATCH] Fix Debian ISO installs failing on the cdrom APT source Since #732, dappnode_install_pre.sh UPDATE exits when apt-get update fails. During a Debian ISO install it runs as a late-command, before d-i comments out the install media's cdrom: source, so apt-get update always fails with "does not have a Release file". The installer then stops at "Failed to run preseeded command", which hangs unattended installs and affects the v0.3.24 Debian ISOs. Comment out cdrom: sources first on ISO installs, as d-i does right afterwards because of apt-setup/disable-cdrom-entries. Failures from the real repositories still abort the install. Co-Authored-By: Claude Opus 5.5 --- scripts/dappnode_install_pre.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/dappnode_install_pre.sh b/scripts/dappnode_install_pre.sh index 84ee41b..c1d5c84 100755 --- a/scripts/dappnode_install_pre.sh +++ b/scripts/dappnode_install_pre.sh @@ -107,8 +107,21 @@ install_iptables() { fi } +# The Debian installer comments out the install media's cdrom: APT source only +# after the late-commands have run. Until then apt-get update fails on it, so +# disable it now as the installer would (apt-setup/disable-cdrom-entries). +disable_iso_cdrom_sources() { + [ "$ISO_INSTALLATION" = "true" ] || return 0 + local sources_file + for sources_file in /etc/apt/sources.list /etc/apt/sources.list.d/*.list; do + [ -f "$sources_file" ] || continue + sed -i -E 's/^(deb(-src)?[[:space:]]+(\[[^]]*\][[:space:]]+)?cdrom:)/# \1/' "$sources_file" + done +} + # HOST UPDATE host_update() { + disable_iso_cdrom_sources # Process substitution keeps apt-get's exit status while still logging its # output. A regular pipeline would return tee's status and hide dpkg errors. apt-get update > >(tee -a "$LOG_FILE") 2>&1 || return $?