udev/mount.sh: Added creation of .hal-mtab, so that unmounting in Thunar
authorMichael Mrozek <EvilDragon@openpandora.de>
Fri, 10 Sep 2010 02:09:57 +0000 (04:09 +0200)
committerMichael Mrozek <EvilDragon@openpandora.de>
Fri, 10 Sep 2010 02:09:57 +0000 (04:09 +0200)
works now.

recipes/udev/udev-151/omap3-pandora/mount.sh
recipes/udev/udev_151.bb

index d69ae9d..420f52f 100755 (executable)
@@ -34,13 +34,18 @@ automount() {
        fi
        ! test -d "/media/$name" && mkdir -p "/media/$name"
        
-       if ! $MOUNT -t auto -o dirsync,noatime,umask=0 $DEVNAME "/media/$name" && ! $MOUNT -t auto -o dirsync,noatime $DEVNAME "/media/$name"
+       
+       if ! $MOUNT -t auto -o dirsync,noatime,umask=0,gid=1000 $DEVNAME "/media/$name" && ! $MOUNT -t auto -o dirsync,noatime,umask=0,gid=1000 $DEVNAME "/media/$name"
        then
                #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!"
-               rm_dir "/media/$name"
+               rmdir "/media/$name"
        else
                logger "mount.sh/automount" "Auto-mount of [/media/$name] successful"
                touch "/tmp/.automount-$name3"
+               fstype=$(cat /etc/mtab | grep $DEVNAME | awk  '{print $3}') 
+               echo "$DEVNAME  1000    0       $fstype dirsync,noatime,umask=0,gid=1000        /media/$name" >> /media/.hal-mtab
+               chgrp wheel /media/.hal-mtab
+               touch /media/.hal-mtab-lock
        fi
 }
        
@@ -82,6 +87,7 @@ if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
        done
        
        # Remove empty directories from auto-mounter
-       
+       sed -e "/$name3/d" /media/.hal-mtab > /tmp/.hal-mtab
+       mv /tmp/.hal-mtab /media/.hal-mtab
        test -e "/tmp/.automount-$name3" && rm_dir "$mnt2"
 fi
index 8e798fb..63b47f8 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 = "r16"
+PR = "r17"
 
 # Untested
 DEFAULT_PREFERENCE = "-1"