tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Automounting removable devices within kde4

On Monday 28 December 2009 05:43:02 David Brownlee wrote:
> With the following revisions of hal and PolicyKit automounting removable
> devices should work fine within kde4 (and probably gnome and suchlike):
> hal-0.5.11nb26 policykit-0.9nb6

   I had the same as your patch to hal here locally (along with a couple of 
others that I haven't committed yet) while trying to get this working.

> The only additional change needed is to add the following to
> /usr/pkg/etc/PolicyKit/PolicyKit.conf inside the <config> block:
>         <match action="">
>                 <return result="yes" />
>         </match>

Rather than modifying PolicyKit.conf, I have consolekit installed and start 
up kde with "ck-launch-session startkde" which seems to have the same 
effect for "the active user".

> With the above plugging in a USB flash drive into my amd64 laptop pops
>  up a notification window, clicking on it opens dolphin, and clicking on
>  the device in dolphin correctly mounted it.

Same thing works for me with a USB flash drive.  An external USB disk drive 
fails however because it is (currently) considered a fixed disk - 
ultimately as its disklabel doesn't have the D_REMOVABLE flag it seems.
My camera also fails in yet another way that I haven't tracked down yet.

I also get lots of messages like the following in syslog

dbus-daemon: Would reject message, 1 matched rules; type="method_call", 
sender=":1.37" (uid=1002 pid=5048 comm="kdeinit4: kdeinit4: kdeinit4: 
kio_trash trash loca") interface="org.freedesktop.DBus.Introspectable" 
member="Introspect" error name="(unset)" requested_reply=0 
destination="org.freedesktop.Hal" (uid=0 pid=401 comm="/usr/pkg/sbin/hald 

I should try your update to policykit and see if it makes any difference.

> If you want to be able to mount filesystems on fixed disks you also need
>  to add:
>         <match action="">
>                 <return result="yes" />
>         </match>

I don't think this is desirable.  I would like to get it so that general 
users can't manipulate real internal disks but can mount additional 
external devices equivalent to what they could do with "mount" directly.

The other patches to hal that I have locally are attached below.  One 
treats apple ufs filesystems as ffs and the other gets the icon displayed 
for optical disks in dolphin et al to be correct (getting optical media to 
work correctly in terms of mounting etc still needs a lot of work).

Index: devinfo_mass.c
RCS file: /src/cvs/netbsd/pkgsrc/sysutils/hal/files/hald-netbsd/devinfo_mass.c,v
retrieving revision 1.3
diff -u -r1.3 devinfo_mass.c
--- devinfo_mass.c      15 Oct 2009 00:30:39 -0000      1.3
+++ devinfo_mass.c      20 Dec 2009 02:20:47 -0000
@@ -110,6 +110,8 @@
                return "ext2";
        case FS_NTFS:
                return "ntfs";
+       case FS_APPLEUFS:
+               return "ffs";
                return NULL;
@@ -127,6 +129,8 @@
                return MBR_PTYPE_LNXEXT2;
        case FS_NTFS:
                return MBR_PTYPE_NTFS;
+       case FS_APPLEUFS:
+               return MBR_PTYPE_APPLE_UFS;
                return MBR_PTYPE_UNUSED;
@@ -394,7 +398,7 @@
                                if (strcmp (type, "vfat") == 0) {
                                        HAL_INFO (("%s disklabel reports %s but 
libvolume_id says it is "
                                            "%s, assuming disklabel is 
-                                           devpath, devinfo_mass_get_fstype 
+                                           devpath, devinfo_mass_get_fstype 
(part->p_fstype), type));
                                        hal_device_property_set_string (d, 
"volume.fstype", type);
Index: devinfo_optical.c
RCS file: 
retrieving revision 1.4
diff -u -r1.4 devinfo_optical.c
--- devinfo_optical.c   18 Jan 2009 13:53:33 -0000      1.4
+++ devinfo_optical.c   20 Dec 2009 02:20:16 -0000
@@ -361,6 +361,7 @@
        hal_device_add_capability (d, "block");
        hal_device_add_capability (d, "volume");
        hal_device_add_capability (d, "volume.disc");
+       hal_device_property_set_string (d, "info.category", "volume");
        /* block */
        sprintf(devstr, "/dev/%s", devnode);

Home | Main Index | Thread Index | Old Index