18 # Nothing to do if ROOTFSTYPE is set to something other than bcachefs
19 if [ -n "$ROOTFSTYPE" -a "$ROOTFSTYPE" != bcachefs ]; then
23 # source for resolve_device() and panic() functions
26 # Resolve the root device (e.g. if root is specified by UUID)
27 DEV=$(resolve_device "$ROOT")
29 # Check if the root device needs unlocking:
30 if bcachefs unlock -c $DEV >/dev/null 2>&1; then
31 if [ "$DEV" == "$ROOT" ]; then
32 echo "Please unlock $DEV:"
34 echo "Please unlock $DEV ($ROOT):"
39 while [ $tries -le 0 -o $count -lt $tries ]; do
40 if bcachefs unlock "$DEV"; then
41 echo "Bcachefs: $DEV successfully unlocked"
48 if [ $tries -gt 0 -a $count -ge $tries ]; then
49 panic "Bcachefs: maximum number of tries exceeded for $DEV"