don't try to automount loopback devices (#1011)
[openwrt.git] / package / base-files / files / etc / hotplug.d / block / 01-mount
index db8ccda..a34580c 100755 (executable)
@@ -3,24 +3,23 @@
 
 DEV=${DEVPATH##*/}
 {
 
 DEV=${DEVPATH##*/}
 {
-echo "ACTION=$ACTION DEVPATH=$DEVPATH $0 $*"
 case "$ACTION" in
 add)
        echo -ne "waiting for $DEV"
        while [ ! -b /dev/$DEV ]; do {
                echo -ne "."
                sleep 1
 case "$ACTION" in
 add)
        echo -ne "waiting for $DEV"
        while [ ! -b /dev/$DEV ]; do {
                echo -ne "."
                sleep 1
-               time=$((time+1)); [ $time -gt 10 ] && break
+               [ $((++time)) -gt 10 ] && break
        }; done
        }; done
+       echo
        
        
-       [ ${DEV%%[0-9]} != ${DEV} ] && {
+       [ ${DEV%%[0-9]} != ${DEV} -a ${DEV%%[0-9]} != "loop" ] && {
                mkdir -p /tmp/$DEV
                mount /dev/$DEV /tmp/$DEV -t auto -o sync
        }
        ;;
 remove)
                mkdir -p /tmp/$DEV
                mount /dev/$DEV /tmp/$DEV -t auto -o sync
        }
        ;;
 remove)
-       umount /tmp/$DEV && rmdir /tmp/$DEV
-       rm -f /dev/$DEV /tmp/$DEV
+       umount /tmp/$DEV && rm -f /dev/$DEV /tmp/$DEV
        ;;
 esac
 } 2>&1 | logger
        ;;
 esac
 } 2>&1 | logger
This page took 0.022138 seconds and 4 git commands to generate.