avoid endless loop
This commit is contained in:
parent
3f2cd7cca5
commit
3f4d039ac9
7
init
7
init
@ -66,7 +66,12 @@ findfs_sh() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# avoid race condition
|
# 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"
|
printf "%s\n" "$device"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user