init: make resolve_device() more readable
This commit is contained in:
parent
1d8b2ca1e9
commit
50d18b28a5
11
init
11
init
@ -33,14 +33,17 @@ resolve_device()
|
|||||||
# Race condition may occur if device manager is not yet initialized device.
|
# Race condition may occur if device manager is not yet initialized device.
|
||||||
# To fix this, we simply waiting until device is available. If device
|
# To fix this, we simply waiting until device is available. If device
|
||||||
# didn't appear in specified time, we panic.
|
# didn't appear in specified time, we panic.
|
||||||
while [ ! -b "$device" ]; do
|
while :; do
|
||||||
if [ "$((count += 1))" = "${rootdelay:=30}" ]; then
|
if [ -b "$device" ]; then
|
||||||
panic "failed to lookup partition"
|
return 0
|
||||||
|
elif [ "$((count += 1))" = "${rootdelay:=30}" ]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
done || :
|
done
|
||||||
|
|
||||||
|
panic "failed to lookup partition"
|
||||||
}
|
}
|
||||||
|
|
||||||
run_hook()
|
run_hook()
|
||||||
|
Loading…
Reference in New Issue
Block a user