Skip to content

Commit

Permalink
zfsbootmenu-ui: fix new populate_be_list for encrypted filesystems
Browse files Browse the repository at this point in the history
  • Loading branch information
ahesford committed Feb 5, 2024
1 parent dae859d commit 96c4d5e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions zfsbootmenu/lib/zfsbootmenu-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ find_be_candidates() {
# returns: 0 iff at least one valid BE was found

populate_be_list() {
local be_list fs ret
local be_list fs ret candidates

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

readarray -t candidates <<< "$( find_be_candidates 2>/dev/null )"

ret=1
while read -r fs; do
for fs in "${candidates[@]}"; do
# Remove any existing cmdline cache
rm -f "$( be_location "${fs}" )/cmdline"

Expand All @@ -659,6 +661,6 @@ populate_be_list() {
echo "${fs}" >> "${be_list}"
ret=0
fi
done <<< "$( find_be_candidates 2>/dev/null )"
done
return $ret
}

0 comments on commit 96c4d5e

Please sign in to comment.