]> code.ossystems Code Review - openembedded-core.git/commitdiff
udev: don't fork so much in mount.sh
authorRoss Burton <ross@openedhand.com>
Mon, 23 Jun 2008 10:27:10 +0000 (10:27 +0000)
committerRoss Burton <ross@openedhand.com>
Mon, 23 Jun 2008 10:27:10 +0000 (10:27 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4717 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/packages/udev/files/mount.sh
meta/packages/udev/udev_115.bb

index 48c78446909e7eb14a4047440e9294318b48a31b..160acbfdeccaf391d676540592b679aa38dfda2d 100644 (file)
@@ -1,16 +1,15 @@
 #!/bin/sh
 #
 # Called from udev
-# Attemp to mount any added block devices 
-# and remove any removed devices
 #
+# Attempt to mount any added block devices and umount any removed devices
+
 
 MOUNT="/bin/mount"
 PMOUNT="/usr/bin/pmount"
 UMOUNT="/bin/umount"
-name="`basename "$DEVNAME"`"
 
-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
@@ -20,6 +19,8 @@ do
 done
 
 automount() {  
+       name="`basename "$DEVNAME"`"
+
        ! test -d "/media/$name" && mkdir -p "/media/$name"
        
        if ! $MOUNT -t auto -o sync $DEVNAME "/media/$name"
@@ -50,8 +51,7 @@ if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
        fi
        
        # If the device isn't mounted at this point, it isn't configured in fstab
-       cat /proc/mounts | awk '{print $1}' | grep -q "^$DEVNAME$" || automount 
-       
+       grep -q "^$DEVNAME " /proc/mounts || automount
 fi
 
 
@@ -63,5 +63,6 @@ if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
        done
        
        # Remove empty directories from auto-mounter
+       name="`basename "$DEVNAME"`"
        test -e "/tmp/.automount-$name" && rm_dir "/media/$name"
 fi
index 0a80af9bd07a37cd4409972d6a44dac873fd0e28..b688ca88db92de0f609f1ce7593d602eaa273ccb 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."
 RPROVIDES_${PN} = "hotplug"
 
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
           file://noasmlinkage.patch;patch=1 \