diff -Nur hal-0.5.7/build-tree/hal-0.5.7/hald/linux2/blockdev.c hal-0.5.7.new/build-tree/hal-0.5.7/hald/linux2/blockdev.c --- hal-0.5.7/hald/linux2/blockdev.c 2006-08-14 11:38:29.000000000 +0200 +++ hal-0.5.7/hald/linux2/blockdev.c 2006-08-14 11:46:13.000000000 +0200 @@ -208,19 +208,23 @@ /* check the underlying device of the mount point */ if (stat (mnt.mnt_dir, &statbuf) != 0) continue; - if (major(statbuf.st_dev) == 0) - continue; + if (strcmp (mnt.mnt_type, "fuse") != 0) { + if (major(statbuf.st_dev) == 0) + continue; + } HAL_INFO (("* found mounts dev %s (%i:%i)", mnt.mnt_fsname, major(statbuf.st_dev), minor(statbuf.st_dev))); /* match against all hal volumes */ for (volume = volumes; volume != NULL; volume = g_slist_next (volume)) { HalDevice *dev; - + char* device_name; + dev = HAL_DEVICE (volume->data); major = hal_device_property_get_int (dev, "block.major"); if (major == 0) continue; minor = hal_device_property_get_int (dev, "block.minor"); + device_name = hal_device_property_get_string (dev, "block.device"); devt = makedev(major, minor); HAL_INFO ((" match %s (%i:%i)", hal_device_get_udi (dev), major, minor)); @@ -238,6 +242,27 @@ volumes = g_slist_delete_link (volumes, volume); break; } + + /* For fuse device, minor/major are different. We will match against hal volume with block.device */ + if (strcmp (mnt.mnt_type, "fuse") == 0) { + if (strcmp (device_name, mnt.mnt_fsname) == 0) { + /* found entry for this device in /proc/mounts */ + device_property_atomic_update_begin (); + hal_device_property_set_bool (dev, "volume.is_mounted", TRUE); + hal_device_property_set_bool (dev, "volume.is_mounted_read_only", + hasmntopt (&mnt, MNTOPT_RO) ? TRUE : FALSE); + hal_device_property_set_string (dev, "volume.mount_point", mnt.mnt_dir); + /* We need special property */ + hal_device_property_set_string (dev, "volume.policy.mount_filesystem", "fuse"); + hal_device_property_set_bool (dev, "volume.ignore", FALSE); + device_property_atomic_update_end (); + HAL_INFO ((" set %s to be mounted at %s (%s)", + hal_device_get_udi (dev), mnt.mnt_dir, + hasmntopt (&mnt, MNTOPT_RO) ? "ro" : "rw")); + volumes = g_slist_delete_link (volumes, volume); + break; + } + } } }