avoid endless loop
This commit is contained in:
parent
3f2cd7cca5
commit
3f4d039ac9
7
init
7
init
@ -66,7 +66,12 @@ findfs_sh() {
|
||||
esac
|
||||
|
||||
# avoid race condition
|
||||
until [ -e "$device" ]; do sleep 0.5; done
|
||||
while [ ! -e "$device" ]; do
|
||||
sleep 0.5
|
||||
[ "$increment" ] || increment=0
|
||||
increment=$(( increment + 1 ))
|
||||
[ "$increment" = 10 ] && panic "failed to lookup rootfs"
|
||||
done
|
||||
|
||||
printf "%s\n" "$device"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user