From 96c4d5e6e479d958c5309546b289a367d8f9885c Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Sun, 4 Feb 2024 22:44:25 -0500 Subject: [PATCH] zfsbootmenu-ui: fix new populate_be_list for encrypted filesystems --- zfsbootmenu/lib/zfsbootmenu-ui.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zfsbootmenu/lib/zfsbootmenu-ui.sh b/zfsbootmenu/lib/zfsbootmenu-ui.sh index c44f2cb..3177ea1 100755 --- a/zfsbootmenu/lib/zfsbootmenu-ui.sh +++ b/zfsbootmenu/lib/zfsbootmenu-ui.sh @@ -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 @@ -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" @@ -659,6 +661,6 @@ populate_be_list() { echo "${fs}" >> "${be_list}" ret=0 fi - done <<< "$( find_be_candidates 2>/dev/null )" + done return $ret }