Skip to content

Commit 2994512

Browse files
committed
zfsbootmenu: attempt initialization if necessary
1 parent 1538998 commit 2994512

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

zfsbootmenu/bin/zfsbootmenu

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,27 @@ unset src sources
2828
mkdir -p "${BASE:=/zfsbootmenu}"
2929

3030
while [ ! -e "${BASE}/initialized" ]; do
31-
if ! timed_prompt -d 5 -e "to cancel" \
32-
-p "Waiting for ZFSBootMenu initialization"; then
33-
34-
zdebug "exited while waiting for initialization"
31+
if ! timed_prompt -d 0 \
32+
-m "$( colorize red "ZFSBootMenu must be initialized to continue" )" \
33+
-r "initialize" \
34+
-e "abort "; then
35+
zdebug "aborted while waiting for initialization"
3536
tput cnorm
3637
tput clear
3738
exit
3839
fi
40+
41+
tput cnorm
42+
tput clear
43+
[ -e "${BASE}/initialized" ] || /libexec/zfsbootmenu-init
3944
done
4045

4146
[ -e "${BASE}/active" ] && takeover
4247

4348
# If the takeover fails for some reason, spin until it ends
4449
while [ -e "${BASE}/active" ]; do
4550
if ! timed_prompt -d 1 -e "to cancel" \
46-
-p "Waiting for other ZFSBootMenu instance to terminate"; then
47-
51+
-p "Waiting for other ZFSBootMenu instance to terminate"; then
4852
zdebug "exited while waiting to own ${BASE}/active"
4953
tput cnorm
5054
tput clear

0 commit comments

Comments
 (0)