fix: Remove obsolete rebuilt custom ISOs (#2077)

This commit is contained in:
Kroese
2026-08-06 14:52:39 +02:00
committed by GitHub
parent 54bf0ed8de
commit 1cef71d265
+12 -3
View File
@@ -419,8 +419,8 @@ skipInstall() {
if [ -n "$previousBase" ]; then if [ -n "$previousBase" ]; then
# Older releases stored the original download name in windows.base. New # Older releases stored the original download name in windows.base. Current
# releases always store the final ISO name, so migrate legacy state once. # releases store an ISO source identity, so migrate legacy state once.
if [[ "${previousBase,,}" != *.iso ]]; then if [[ "${previousBase,,}" != *.iso ]]; then
if isCompressed "$previousBase" || [[ "${previousBase,,}" == *.esd ]]; then if isCompressed "$previousBase" || [[ "${previousBase,,}" == *.esd ]]; then
@@ -437,6 +437,15 @@ skipInstall() {
fi fi
# Older releases may have left a rebuilt custom ISO at its synthetic source
# identity. A completed installation no longer needs that installation media.
if [[ "${previousBase,,}" == "windows."* ]] && [ -f "$boot" ] && hasData; then
if ! rm -f -- "$STORAGE/$previousBase"; then
error "Failed to remove obsolete ISO file \"$STORAGE/$previousBase\" !"
exit 50
fi
fi
# A changed source invalidates an unfinished installation. Back up an # A changed source invalidates an unfinished installation. Back up an
# existing installation, but discard stale media when no disk exists yet. # existing installation, but discard stale media when no disk exists yet.
if [[ "${STORAGE,,}/${previousBase,,}" != "${iso,,}" ]]; then if [[ "${STORAGE,,}/${previousBase,,}" != "${iso,,}" ]]; then
@@ -590,7 +599,7 @@ findFile() {
ISO="$file" ISO="$file"
CUSTOM="$file" CUSTOM="$file"
# Include the custom ISO size in its persistent name so replacing a # Encode the custom ISO size in a synthetic source identity so replacing a
# bind-mounted ISO is detected as a different installation source. # bind-mounted ISO is detected as a different installation source.
BOOT="$STORAGE/windows.$size.iso" BOOT="$STORAGE/windows.$size.iso"