Bug#281887: add patches for pmount interoperability

Sjoerd Simons Sjoerd Simons <sjoerd@luon.net>, 281887@bugs.debian.org
Thu, 18 Nov 2004 12:42:15 +0100


This is a multi-part MIME message sent by reportbug.

--===============1311450179==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: gnome-vfs2
Severity: wishlist
Tags: patch

Hi, 

  I'm working on getting gnome-volume-manager and hal work correctly with
  pmount, so there is no need to edit fstab.

  Unfortunately volumes that are pmounted can't be unmounted by the user with
  normal mount (no fstab entry) and aren't show on the desktop (gnome-vfs uses
  fstab to decide that).

  Two resolve these problems two patches are attached
  
  09_pmount.patch:
    
    Use pumount for unmounting if it exists. This is the same patch as in
    the ubuntu gnome-vfs2 package, but improved a little to test if the command
    is executable instead of just there. Thus for users not in the plugdev
    group, umount is used even if pumount is available on the system.

  12_user_visible_drives.patch:

    Because they have no fstab entry, pmounted drives are not marked as
    user-visible. The patch makes everything under /media user-visible, which
    is where pmounts mount all it drives. Patch is taken directly from the
    ubuntu package, so should be well tested.

  Sjoerd

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: powerpc (ppc)
Kernel: Linux 2.6.9-spring
Locale: LANG=C, LC_CTYPE=nl_NL@euro (charmap=ISO-8859-15)

--===============1311450179==
Content-Type: text/x-c; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="09_pmount.patch"

diff -Naur gnome-vfs2-2.8.3-old/libgnomevfs/gnome-vfs-volume-ops.c gnome-vfs2-2.8.3/libgnomevfs/gnome-vfs-volume-ops.c
--- gnome-vfs2-2.8.3-old/libgnomevfs/gnome-vfs-volume-ops.c	2004-11-18 11:39:58.000000000 +0100
+++ gnome-vfs2-2.8.3/libgnomevfs/gnome-vfs-volume-ops.c	2004-11-18 11:40:38.000000000 +0100
@@ -57,6 +57,7 @@
 };
 
 static const char *umount_known_locations [] = {
+	"/usr/bin/pumount", "/bin/pumount",
 	"/sbin/umount", "/bin/umount",
 	"/usr/sbin/umount", "/usr/bin/umount",
 	NULL
@@ -76,7 +77,7 @@
 	int i;
 
 	for (i = 0; known_locations [i]; i++){
-		if (g_file_test (known_locations [i], G_FILE_TEST_EXISTS))
+		if (g_file_test (known_locations [i], G_FILE_TEST_IS_EXECUTABLE))
 			return known_locations [i];
 	}
 	return NULL;
@@ -339,7 +340,7 @@
 	       name = mount_point;
        }
 #else
-       name = mount_point;
+       name = device_path;
 #endif
        
        if (should_mount) {

--===============1311450179==
Content-Type: text/x-c; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="12_user_visible_drives.patch"

Nur in gnome-vfs2-2.8.1.old/debian/patches: 12_user_visible_drives.patch.
diff -ru gnome-vfs2-2.8.1.old/libgnomevfs/gnome-vfs-volume-monitor-daemon.c gnome-vfs2-2.8.1/libgnomevfs/gnome-vfs-volume-monitor-daemon.c
--- gnome-vfs2-2.8.1.old/libgnomevfs/gnome-vfs-volume-monitor-daemon.c	2004-09-23 15:20:46.099901960 +0200
+++ gnome-vfs2-2.8.1/libgnomevfs/gnome-vfs-volume-monitor-daemon.c	2004-09-23 15:23:00.649447320 +0200
@@ -954,6 +954,10 @@
 		vol->priv->is_user_visible = 1;
 		break;
 	default:
+		/* additionally mark devices below /media/ as user visible, in
+		 * case they are not recognized as devices above */
+		if (!strncmp (mount->mount_path, "/media/", 7))
+			vol->priv->is_user_visible = 1;
 		break;
 	}
 	

--===============1311450179==--