# HG changeset patch # User Pascal Bellard # Date 1296930024 -3600 # Node ID f12a7bdb3980bf0cadc95a50463c0f8c02b89ce7 # Parent fcdf41a689c83b205bd302e8de6c8b9cdea3379e bootopts.sh: try to shortcut USBDELAY diff -r fcdf41a689c8 -r f12a7bdb3980 etc/init.d/bootopts.sh --- a/etc/init.d/bootopts.sh Sat Feb 05 19:02:40 2011 +0100 +++ b/etc/init.d/bootopts.sh Sat Feb 05 19:20:24 2011 +0100 @@ -92,17 +92,20 @@ DEVICE=${opt#home=} [ "$DEVICE" = "usb" ] && DEVICE=sda1 echo "Home has been specified to $DEVICE..." - USBDELAY=`cat /sys/module/usb_storage/parameters/delay_use` - USBDELAY=$((2+$USBDELAY)) - echo "Sleeping $USBDELAY s to let the kernel detect the device... " - sleep $USBDELAY + DEVID=`/sbin/blkid | sed 'p;s/"//g' | grep "$DEVICE" | sed 's/:.*//;q'` + if [ -z "$DEVID" ]; then + USBDELAY=`cat /sys/module/usb_storage/parameters/delay_use` + USBDELAY=$((2+$USBDELAY)) + echo "Sleeping $USBDELAY s to let the kernel detect the device... " + sleep $USBDELAY + fi USER=`cat /etc/passwd | sed '/:1000:/!d;s/:.*//;q'` DEVID=$DEVICE if [ -x /sbin/blkid ]; then # Can be a label, uuid, type or devname. DEVID gives us first: /dev/name. DEVID=`/sbin/blkid | sed 'p;s/"//g' | grep "$DEVICE" | sed 's/:.*//;q'` - DEVID=${DEVID##*/} fi + DEVID=${DEVID##*/} if [ -n "$DEVID" ] && grep -q "$DEVID" /proc/partitions ; then echo "Mounting /home on /dev/$DEVID... " [ -d /home/$USER ] && mv /home/$USER /tmp/$USER-files