Skip to content

Commit

Permalink
zfsbootmenu: add zbm.waitfor argument handler
Browse files Browse the repository at this point in the history
With keyfiles being stored on USB drives, the boot process can be
non-deterministic due to intermittently missing /dev entries. Users can
now provide one or more devices that must be present before the pool
import process can start. Unlike dracut, you can simply hit the escape
key to cancel this check.
  • Loading branch information
zdykstra committed Jan 15, 2024
1 parent 3785c03 commit 67872c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zfsbootmenu/libexec/zfsbootmenu-init
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ if [ -n "${zbm_waitfor_devices}" ]; then
for device in "${user_devices[@]}"; do
case "${device}" in
/dev/*)
((EXPECTED++))
((EXPECTED=EXPECTED+1))
if [ -e "${device}" ] ; then
((FOUND++))
((FOUND=FOUND+1))
else
missing+=( "$device" )
fi
;;
*=*)
((EXPECTED++))
((EXPECTED=EXPECTED+1))
path_prefix="/dev/disk/by-${device%=*}"
checkfor="${path_prefix,,}/${device##*=}"
if [ -e "${checkfor}" ] ; then
((FOUND++))
((FOUND=FOUND+1))
else
missing+=( "$device" )
fi
Expand Down

0 comments on commit 67872c8

Please sign in to comment.