tFix opening when device identification is^Hwas too slow - tomb - the crypto undertaker
HTML git clone git://parazyd.org/tomb.git
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit d7b4313b0835d6e14cf934ec81c0e3d8f0940552
DIR parent fcfa222e4a9017d69c2475d1e10d7c2250112d06
HTML Author: Hellekin O. Wolf =8) <hellekin@cepheide.org>
Date: Fri, 11 Feb 2011 03:56:09 +0100
Fix opening when device identification is^Hwas too slow
Diffstat:
M src/tomb | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
DIR diff --git a/src/tomb b/src/tomb
t@@ -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