From 65fd7c839c068dba1c8f6f1487c58b3cea8922f8 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 28 Feb 2025 03:55:17 +0100 Subject: [PATCH] feat: Check path to boot.iso (#184) --- src/install.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/install.sh b/src/install.sh index 9691de9..185f2ae 100644 --- a/src/install.sh +++ b/src/install.sh @@ -165,11 +165,16 @@ convertImage() { findFile() { - local ext="$1" local file + local ext="$1" + local fname="boot.$ext" - file=$(find / -maxdepth 1 -type f -iname "boot.$ext" | head -n 1) - [ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "boot.$ext" | head -n 1) + if [ -d "/$fname" ]; then + warn "The file /$fname has an invalid path!" + fi + + file=$(find / -maxdepth 1 -type f -iname "$fname" | head -n 1) + [ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$fname" | head -n 1) detectType "$file" && return 0 return 1