Skip to content

Commit 96c4d5e

Browse files
committed
zfsbootmenu-ui: fix new populate_be_list for encrypted filesystems
1 parent dae859d commit 96c4d5e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

zfsbootmenu/lib/zfsbootmenu-ui.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ find_be_candidates() {
634634
# returns: 0 iff at least one valid BE was found
635635

636636
populate_be_list() {
637-
local be_list fs ret
637+
local be_list fs ret candidates
638638

639639
be_list="${1}"
640640
if [ -z "${be_list}" ]; then
@@ -646,8 +646,10 @@ populate_be_list() {
646646
# Truncate the list to avoid stale entries
647647
: > "${be_list}"
648648

649+
readarray -t candidates <<< "$( find_be_candidates 2>/dev/null )"
650+
649651
ret=1
650-
while read -r fs; do
652+
for fs in "${candidates[@]}"; do
651653
# Remove any existing cmdline cache
652654
rm -f "$( be_location "${fs}" )/cmdline"
653655

@@ -659,6 +661,6 @@ populate_be_list() {
659661
echo "${fs}" >> "${be_list}"
660662
ret=0
661663
fi
662-
done <<< "$( find_be_candidates 2>/dev/null )"
664+
done
663665
return $ret
664666
}

0 commit comments

Comments
 (0)