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