kernel-install: check all entry candidates first, then check existence of $pref/loader/entries only once

If we have multiple entries in $ENTRY_TOKEN_SEARCH, and $pref/loader/entries
exists, then previously we would always exit after the first candidate and
ignore the second and later candidates.

Follow-up for 1b43f86893.
This commit is contained in:
Yu Watanabe
2023-03-17 20:41:17 +09:00
parent 561d801370
commit b0e339547f
+8 -8
View File
@@ -217,15 +217,15 @@ for pref in $BOOT_ROOT_SEARCH; do
else
log_verbose "$pref/$suff not found…"
fi
if [ -d "$pref/loader/entries" ]; then
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="$pref"
log_verbose "$pref/loader/entries exists, using BOOT_ROOT=$BOOT_ROOT"
break 2
else
log_verbose "$pref/loader/entries not found…"
fi
done
if [ -d "$pref/loader/entries" ]; then
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="$pref"
log_verbose "$pref/loader/entries exists, using BOOT_ROOT=$BOOT_ROOT"
break
else
log_verbose "$pref/loader/entries not found…"
fi
done
[ -z "$BOOT_ROOT" ] && for pref in "/efi" "/boot/efi"; do