Fix opening when device identification is^Hwas too slow

This commit is contained in:
Hellekin O. Wolf =8) 2011-02-11 03:56:09 +01:00
parent fcfa222e4a
commit d7b4313b08

View File

@ -104,7 +104,19 @@ ask_usbkey() {
echo -n " . usb attached, opening "
# get the first partition
usbpart=`dmesg |tail -n 12 | grep ' sd.:' |cut -d: -f2 |tr -d ' '`
# usbpart=`dmesg |tail -n 12 | grep ' sd.:' |cut -d: -f2 |tr -d ' '`
for i in $(seq 1 10); do
usbpart=$(dmesg | tail -n 12 | sed '/ sd.:/!d;s/^.*: \(sd.[0-9]*\)/\1/')
if [ -n "$usbpart" ]; then
break
elif [ $i -eq 10 ]; then
error "timeout."
return 1
else
echo -n .
sleep 1
fi
done
# # wait that is mounted (it automount is on)
# c=0