udev_151: Fixed mount.sh to not use cache with blkid
authorMichael Mrozek <EvilDragon@openpandora.de>
Tue, 29 Jun 2010 01:59:10 +0000 (03:59 +0200)
committerMichael Mrozek <EvilDragon@openpandora.de>
Tue, 29 Jun 2010 01:59:10 +0000 (03:59 +0200)
recipes/udev/udev-151/omap3-pandora/mount.sh
recipes/udev/udev_151.bb

index 5f20c85..979fb27 100755 (executable)
@@ -10,10 +10,10 @@ PMOUNT="/usr/bin/pmount"
 UMOUNT="/bin/umount"
 blkid="/usr/sbin/blkid"
 name="`basename "$DEVNAME"`"
-name2="`$blkid "$DEVNAME" -o value -s LABEL`"
+name2="`$blkid "$DEVNAME" -c /dev/null -o value -s LABEL`"
 name3=$(echo $DEVNAME | sed 's/.*dev.//g')
 
-for line in `cat /etc/udev/mount.blacklist | grep -v ^#`
+for line in `grep -v ^# /etc/udev/mount.blacklist`
 do
        if ( echo "$DEVNAME" | grep -q "$line" )
        then
@@ -26,7 +26,7 @@ automount() {
        if [ -n "$name2" ] 
        then
                c=1
-               while ( cat /proc/mounts | grep "/media/$name2" ); do
+               while ( grep "/media/$name2"  /proc/mounts); do
                        name2="$name2-$c"
                        c=$(expr $c + 1)
                done
@@ -41,7 +41,6 @@ automount() {
        else
                logger "mount.sh/automount" "Auto-mount of [/media/$name] successful"
                touch "/tmp/.automount-$name3"
-               echo $name3 > /tmp/test
        fi
 }
        
@@ -73,7 +72,7 @@ if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
 fi
 
 if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
-       for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
+       for mnt in `grep "$DEVNAME" /proc/mounts | cut -f 2 -d " " `
        do
                # 20100306: Remove the mount point forcibly (Lazy) as the user has already removed the device by the 
                # DJWillis: time this fires so any handles are bad anyway. This should stop 'stale' folders being
index ac6afe3..8081855 100644 (file)
@@ -3,7 +3,7 @@ DESCRIPTION = "udev is a daemon which dynamically creates and removes device nod
 the hotplug package and requires a kernel not older than 2.6.12."
 LICENSE = "GPLv2+"
 
-PR = "r13"
+PR = "r14"
 
 # Untested
 DEFAULT_PREFERENCE = "-1"