--- usb.agent.orig	2005-08-22 19:56:33.000000000 +0100
+++ usb.agent	2005-08-22 20:00:19.000000000 +0100
@@ -135,10 +135,14 @@
     fi
 
     # we could be running before usb populated these attributes...
-    if [ ! -f $SYSFS/$DEVPATH/bNumConfigurations ]; then
-	# FIXME wait till they appear, or N seconds elapse
-	sleep 2
-    fi
+    timeout_count=0
+    while [ ! -f $SYSFS/$DEVPATH/bNumConfigurations ]; do
+	sleep 0.2
+	timeout_count=$((timeout_count+1))
+	if [ "$timeout_count" -ge 20 ]; then
+	    break
+	fi
+    done
 
     # this could care about changing the default config, or warning
     # when the user hooked a fast device up so it runs slowly.
