From 128c1687043d0f560fcdc1984522e68231ee7d94 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 30 May 2026 18:08:53 +0200 Subject: [PATCH 1/2] fix: Restart caused boot error --- src/install.sh | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/install.sh b/src/install.sh index 161e91c..9de52a2 100644 --- a/src/install.sh +++ b/src/install.sh @@ -52,6 +52,31 @@ downloadFile() { return 1 } +bootFile() { + + local file="$1" + local ext="${file##*.}" + local dest="$STORAGE/boot.$ext" + + if [[ "$file" == "$dest" ]]; then + BOOT="$file" + return 0 + fi + + if [[ "${file,,}" == "/boot.${ext,,}" || "${file,,}" == "/custom.${ext,,}" ]]; then + BOOT="$file" + return 0 + fi + + if ! mv -f "$file" "$dest"; then + error "Failed to move $file to $dest !" + return 1 + fi + + BOOT="$dest" + return 0 +} + findFile() { local dir file @@ -74,6 +99,8 @@ findFile() { [ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$fname" -print -quit) [ ! -s "$file" ] && return 1 + ! bootFile "$file" && return 1 + return 0 } @@ -85,6 +112,7 @@ fi findFile "boot" "iso" && return 0 findFile "boot" "img" && return 0 +findFile "boot" "raw" && return 0 findFile "boot" "qcow2" && return 0 if hasDisk; then @@ -114,13 +142,6 @@ if ! downloadFile "$URL" "$base" "$name"; then rm -f "$STORAGE/$base" && exit 60 fi -ext="${base##*.}" -dest="$STORAGE/boot.$ext" - -if ! mv -f "$STORAGE/$base" "$dest"; then - error "Failed to move file to $dest !" && exit 61 -fi +! bootFile "$STORAGE/$base" "$dest" && exit 61 -BOOT="$dest" - return 0 From ef9e3c84f824376c70471f85e31e0b84db3ead8f Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 30 May 2026 18:15:43 +0200 Subject: [PATCH 2/2] Update install.sh --- src/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/install.sh b/src/install.sh index 9de52a2..11602ce 100644 --- a/src/install.sh +++ b/src/install.sh @@ -142,6 +142,6 @@ if ! downloadFile "$URL" "$base" "$name"; then rm -f "$STORAGE/$base" && exit 60 fi -! bootFile "$STORAGE/$base" "$dest" && exit 61 +! bootFile "$STORAGE/$base" && exit 61 return 0