diff options
author | Danny Kukawka <danny.kukawka@web.de> | 2010-02-22 16:15:31 +0100 |
---|---|---|
committer | Danny Kukawka <danny.kukawka@web.de> | 2010-02-22 16:15:31 +0100 |
commit | 534beb6766ebc78543c94dc4b760c32312a62289 (patch) | |
tree | 90678ffba8a81f5958127b2cce0f8d57c1b3db12 | |
parent | a1718c626d9247daafc53ec374154d2a4736c736 (diff) | |
parent | 9c940ee21009abb338182f5774d6ece0e9dd6eb9 (diff) |
Merge branch 'master' of ssh://dkukawka@git.freedesktop.org/git/hal
-rw-r--r-- | NEWS | 136 | ||||
-rw-r--r-- | configure.in | 46 | ||||
-rw-r--r-- | fdi/policy/10osvendor/10-x11-input.fdi | 8 | ||||
-rw-r--r-- | hald/freebsd/addons/addon-storage.c | 29 | ||||
-rw-r--r-- | hald/freebsd/hf-storage.c | 39 | ||||
-rw-r--r-- | hald/freebsd/hf-usb.c | 8 | ||||
-rw-r--r-- | hald/freebsd/hf-usb2.c | 65 | ||||
-rw-r--r-- | hald/freebsd/hf-volume.c | 5 | ||||
-rw-r--r-- | hald/freebsd/probing/Makefile.am | 2 | ||||
-rw-r--r-- | hald/freebsd/probing/probe-hiddev.c | 2 | ||||
-rw-r--r-- | hald/freebsd/probing/probe-usb2-device.c | 4 | ||||
-rw-r--r-- | hald/freebsd/probing/probe-usb2-interface.c | 6 | ||||
-rw-r--r-- | hald/freebsd/probing/probe-volume.c | 12 | ||||
-rwxr-xr-x | hald/haldaemon.in | 2 | ||||
-rw-r--r-- | hald/linux/device.c | 9 | ||||
-rw-r--r-- | hald/linux/probing/probe-input.c | 2 | ||||
-rw-r--r-- | hald/util.h | 2 |
17 files changed, 283 insertions, 94 deletions
@@ -1,9 +1,42 @@ ========== -HAL 0.5.14 +HAL 0.5.15 ========== Released Month 00, 2009. +Requirements for HAL 0.5.15: + + - Linux kernel >= 2.6.22 (CONFIG_SYSFS_DEPRECATED=n) + - udev >= 125 (Linux only) + - util-linux-ng >= 2.15 + - bash >= 2.0 + - dbus >= 0.61 (with glib bindings) + - glib >= 2.10.0 + - expat >= 1.95.8 + - hal-info >= 20080310 (older versions can work too) + - libusb >= 0.1.10a (optional) + - pciutils >= 2.2.3 (optional) + - dmidecode >= 2.7 (optional) + - parted >= 1.7.1 (optional) + - cryptsetup-luks >= 1.0.1 (optional, needs LUKS patches) + - libsmbios >= 0.13.4 (optional, for DELL machines, Linux only, + prefered version >= 2.0.3) + - dellWirelessCtl >= 0.13.4 (optional, for Dell machines, must live in + /usr/bin/, Linux only, prefered version >= 2.0.3) + - gperf >= 3.0.3-2 (optional, for Re-map multimedia keys, + Linux only) + - PolicyKit >= 0.5 (optional) + - ConsoleKit >= 0.2.0 (optional, needed if use PolicyKit) + - pm-utils >= 0.99.2 or newer (optional) + +Contributors to HAL 0.5.15: + +========== +HAL 0.5.14 "Dave, this conversation can serve no purpose anymore. Goodbye." +========== + +Released November 30, 2009. + Requirements for HAL 0.5.14: - Linux kernel >= 2.6.22 (CONFIG_SYSFS_DEPRECATED=n) @@ -31,6 +64,107 @@ Requirements for HAL 0.5.14: Contributors to HAL 0.5.14: +Arnout Vandecappelle (1): + don't remove scsi_host if there are still targets using it + +Aurelien Jarno (2): + Fix build failure on GNU/kFreeBSD + generalize keyboard detection code for FreeBSD + +C. Scott Ananian (1): + remove action_parameters from DBus XML for IsCallerPrivileged + +Danny Kukawka (40): + fixed commit 36d076bf26350e022731cb7c2c9f4e840dd25e37 + move ssb bus code to the correct place + add SSB bus to SPEC + cleanup: don't set udi manually if hal_device_set_udi() was used + add IBM Ebus to SPEC + hide more MBR, bootstrap and other partitions from desktop + fix code doc for resolve_udiprop_path() + hald_dbus.c: fix DBusError handling + hald_runner.c: fix usage of DBusError + ci-tracker.c: fix usage of DBusError + ck-tracker.c: fix usage of DBusError + more DBusError fixes + another DBusError fix + fix configure to get --disable-console-kit working + fix probe-ieee1394-unit.c DBusError and LibHalContext handling + fix DBusError handling in probe directory + free string after usage + fix usage of deprected g_io_channel_seek() + replace deprecated g_basename() with g_path_get_basename() + replace another deprecated g_basename() with g_path_get_basename() + replace deprecated g_strcasecmp() with g_ascii_strcasecmp() + fix DBusError handling in linux addon directory + Merge branch 'master' of ssh://dkukawka@git.freedesktop.org/git/hal + fix compiler warning in libhal-storage + fix commit 141ca8cd7b768ddefa1bfaa563cbef4337e32b7c + extend debug message in device_reprobe() + fix hotplug_event_process_queue() to get reprobe working + handle keyboard backlight leds via org.freedesktop.Hal.Device.KeyboardBacklight + changed massif-hald.sh to work the same way as run-hald.sh + changed valgrind-hald.sh to write a logfile + fix memory leaks due to usage of g_path_get_basename() + add hald/valgrind.log to .gitignore + fix memory leak in acpi_button_add() in error case + fix memory leak due to usage of g_strdup() + fix DBusError handling in freebsd code + adopted version of commit 122e41a10 to fix docking stations + add keyboard_backlight.* and *.num_levels to led class + update SPEC with kbd_backlight(.*) and leds.num_levels + always set leds.num_levels since it's mandatory + add a check for leds.num_levels to addon-leds.c + +Dmitry Torokhov (1): + Correctly identify touchpads + +Drew Moseley (1): + add libhal_device_property_remove_watch_all() to libhal + +Frederic Crozat (1): + hide Windows recovery partitions on pre-installed Futjisu laptops + +Joe Marcus Clarke (17): + re-enable libvolume_id support for FreeBSD + add USB2 support to the FreeBSD backend + add support for reading ufsids + add some missing storage properties + add USB2 support + fix support for power and brightness management + fix a problem building the FreeBSD backend + add USB2 support + add support for mouse device probing + add support for Fuse mounts + add support for newer GEOM types + add support for polling of mouse devices + add missing LDADD and CFLAGS for addon-mouse.c + add locking support to the storage addon + update time handling functions + ignore probe devices + fix DBusError handling and a memory leak + +Johannes Hessellund (1): + read brightness from actual_brightness and not from brightness + +Kay Sievers (1): + configure.in: require blkid >= 2.15 from util-linux-ng + +Maciej Grela (1): + Remove the 512 byte limit for PATH in hald.c + +Martin Poole (1): + Fix a segfault in the mdraid code -- see rh#507782 for more info + +Michael Biebl (7): + Make libhald_freebsd_probe.la a noinst library. + fix a misleading warning in ondemand_set_consider_nice() + Fix a crasher in hal_util_get_last_element + Fix unconditional usage of PATH_MAX + Support relative paths in umount.hal + list "relatime" as valid mount option on Linux. + Fix build failures with binutils-gold + ========== HAL 0.5.13 ========== diff --git a/configure.in b/configure.in index e8aa021e..2394c456 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ dnl Process this file with autoconf to produce a configure script. # AC_PREREQ(2.59c) -AC_INIT(hal, 0.5.14, david@fubar.dk) +AC_INIT(hal, 0.5.15, david@fubar.dk) AM_INIT_AUTOMAKE([gnu 1.9]) AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -479,9 +479,6 @@ if test "x$with_libpci" != xno ; then fi AM_CONDITIONAL([HAVE_LIBPCI], [test "x$USE_LIBPCI" = "xyes"]) -USE_LIBUSB20=no -USE_LIBUSB=no -LIBUSB20_LIBS="" AC_ARG_WITH([backend], AS_HELP_STRING([--with-backend=<name>], [backend to use (linux/solaris/freebsd/dummy)]), @@ -510,21 +507,34 @@ AM_CONDITIONAL(HALD_COMPILE_FREEBSD, [test x$HALD_BACKEND = xfreebsd], [Compilin AM_CONDITIONAL(HALD_COMPILE_SOLARIS, [test x$HALD_BACKEND = xsolaris], [Compiling for Solaris]) AC_SUBST(HALD_BACKEND) if test "x$HALD_BACKEND" = "xfreebsd"; then - AC_CHECK_LIB([usb20], [libusb20_dev_get_info], [USE_LIBUSB20=yes], [USE_LIBUSB20=no]) -fi -if test "x$USE_LIBUSB20" = "xno"; then - AC_CHECK_LIB([usb], [libusb20_dev_get_info], [USE_LIBUSB=yes], [USE_LIBUSB=no]) -fi -AM_CONDITIONAL([HAVE_LIBUSB20],[test "x$USE_LIBUSB20" = "xyes"]) -AM_CONDITIONAL([HAVE_LIBUSB20],[test "x$USE_LIBUSB" = "xyes"]) -if test "x$USE_LIBUSB20" = "xyes"; then - AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libusb20]) - LIBUSB20_LIBS="-lusb20" -elif test "x$USE_LIBUSB" = "xyes"; then - AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libsub20]) - LIBUSB20_LIBS="-lusb" + AC_SEARCH_LIBS([clock_gettime], [rt]) + LIBUFS_LIBS="" + AC_CHECK_HEADERS([libufs.h], + [AC_CHECK_LIB([libufs], [ufs_disk_fillout], [USE_LIBUFS="yes"], [], [])]) + if test "x$USE_LIBUFS" = "xyes"; then + AC_DEFINE(HAVE_LIBUFS, 1, [Set if we have libufs]) + LIBUFS_LIBS="-lufs" + AC_SUBST(LIBUFS_LIBS) + fi + USE_BSDLIBUSB20=no + USE_BSDLIBUSB=no + LIBUSB20_LIBS="" + AC_CHECK_LIB([usb20], [libusb20_dev_get_info], [USE_BSDLIBUSB20=yes], [USE_BSDLIBUSB20=no]) + if test "x$USE_BSDLIBUSB20" = "xno"; then + AC_CHECK_LIB([usb], [libusb20_dev_get_info], [USE_BSDLIBUSB=yes], [USE_BSDLIBUSB=no]) + fi + AM_CONDITIONAL([HAVE_LIBUSB20],[test "x$USE_BSDLIBUSB20" = "xyes" -o "x$USE_BSDLIBUSB" = "xyes"]) + if test "x$USE_BSDLIBUSB20" = "xyes"; then + AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libusb20]) + LIBUSB20_LIBS="-lusb20" + elif test "x$USE_BSDLIBUSB" = "xyes"; then + AC_DEFINE(HAVE_LIBUSB20, 1, [Set if we need libsub20]) + LIBUSB20_LIBS="-lusb" + fi + AC_SUBST(LIBUSB20_LIBS) +else + AM_CONDITIONAL([HAVE_LIBUSB20], [false]) fi -AC_SUBST(LIBUSB20_LIBS) dnl DBUS API is subject to changes AC_DEFINE_UNQUOTED(DBUS_API_SUBJECT_TO_CHANGE, [], [DBUS API is subject to change]) diff --git a/fdi/policy/10osvendor/10-x11-input.fdi b/fdi/policy/10osvendor/10-x11-input.fdi index cff8fc55..8bbe263e 100644 --- a/fdi/policy/10osvendor/10-x11-input.fdi +++ b/fdi/policy/10osvendor/10-x11-input.fdi @@ -16,6 +16,14 @@ </match> </match> + <match key="info.capabilities" contains="input.touchpad"> + <merge key="input.x11_driver" type="string">mouse</merge> + <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" + string="Linux"> + <merge key="input.x11_driver" type="string">evdev</merge> + </match> + </match> + <match key="info.capabilities" contains="input.tablet"> <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux"> diff --git a/hald/freebsd/addons/addon-storage.c b/hald/freebsd/addons/addon-storage.c index 31250373..cd285811 100644 --- a/hald/freebsd/addons/addon-storage.c +++ b/hald/freebsd/addons/addon-storage.c @@ -107,8 +107,7 @@ hf_addon_storage_update (void) if (hf_addon_storage_cdrom_eject_pressed(cdrom)) { - libhal_device_emit_condition(hfp_ctx, hfp_udi, "EjectPressed", "", &hfp_error); - dbus_error_free(&hfp_error); + libhal_device_emit_condition(hfp_ctx, hfp_udi, "EjectPressed", "", NULL); } hfp_cdrom_free(cdrom); @@ -164,19 +163,17 @@ unmount_volumes (void) "block.storage_device", hfp_udi, &num_volumes, - &hfp_error)) != NULL) + NULL)) != NULL) { int i; - dbus_error_free(&hfp_error); - for (i = 0; i < num_volumes; i++) { char *vol_udi; vol_udi = volumes[i]; - if (libhal_device_get_property_bool(hfp_ctx, vol_udi, "volume.is_mounted", &hfp_error)) + if (libhal_device_get_property_bool(hfp_ctx, vol_udi, "volume.is_mounted", NULL)) { DBusMessage *msg = NULL; DBusMessage *reply = NULL; @@ -185,7 +182,6 @@ unmount_volumes (void) char **options = NULL; char *devfile; - dbus_error_free(&hfp_error); hfp_info("Forcing unmount of volume '%s'", vol_udi); dbus_connection = libhal_ctx_get_dbus_connection(hfp_ctx); @@ -265,10 +261,9 @@ poll_for_media (boolean check_only, boolean force) check_lock_state = FALSE; hfp_info("Checking whether device %s is locked by HAL", addon.device_file); - if (libhal_device_is_locked_by_others(hfp_ctx, hfp_udi, "org.freedesktop.Hal.Device.Storage", &hfp_error)) + if (libhal_device_is_locked_by_others(hfp_ctx, hfp_udi, "org.freedesktop.Hal.Device.Storage", NULL)) { hfp_info("... device %s is locked by HAL", addon.device_file); - dbus_error_free(&hfp_error); is_locked_by_hal = TRUE; update_proc_title(addon.device_file); goto skip_check; @@ -278,10 +273,8 @@ poll_for_media (boolean check_only, boolean force) hfp_info("... device %s is not locked by HAL", addon.device_file); is_locked_by_hal = FALSE; } - dbus_error_free(&hfp_error); - should_poll = libhal_device_get_property_bool(hfp_ctx, hfp_udi, "storage.media_check_enabled", &hfp_error); - dbus_error_free(&hfp_error); + should_poll = libhal_device_get_property_bool(hfp_ctx, hfp_udi, "storage.media_check_enabled", NULL); polling_disabled = ! should_poll; update_proc_title(addon.device_file); } @@ -314,8 +307,7 @@ poll_for_media (boolean check_only, boolean force) unmount_volumes(); #endif - libhal_device_rescan(hfp_ctx, hfp_udi, &hfp_error); - dbus_error_free(&hfp_error); + libhal_device_rescan(hfp_ctx, hfp_udi, NULL); addon.had_media = has_media; return TRUE; @@ -412,12 +404,10 @@ main (int argc, char **argv) ! strcmp(driver, "cd")))) && ! strcmp(removable, "true"); addon.had_media = poll_for_media(TRUE, FALSE); - if (! libhal_device_addon_is_ready(hfp_ctx, hfp_udi, &hfp_error)) + if (! libhal_device_addon_is_ready(hfp_ctx, hfp_udi, NULL)) goto end; - dbus_error_free(&hfp_error); - syscon = dbus_bus_get(DBUS_BUS_SYSTEM, &hfp_error); - dbus_error_free(&hfp_error); + syscon = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); assert(syscon != NULL); dbus_connection_set_exit_on_disconnect(syscon, 0); @@ -452,12 +442,11 @@ main (int argc, char **argv) " <method name=\"CheckForMedia\">\n" " <arg name=\"call_had_sideeffect\" direction=\"out\" type=\"b\"/>\n" " </method>\n", - &hfp_error)) + NULL)) { hfp_critical("Cannot claim interface 'org.freedesktop.Hal.Device.Storage.Removable'"); goto end; } - dbus_error_free(&hfp_error); while (TRUE) { diff --git a/hald/freebsd/hf-storage.c b/hald/freebsd/hf-storage.c index 3bc5ab92..3833ec8e 100644 --- a/hald/freebsd/hf-storage.c +++ b/hald/freebsd/hf-storage.c @@ -30,6 +30,7 @@ #include <limits.h> #include <inttypes.h> #include <string.h> +#include <unistd.h> #include <sys/param.h> #include <sys/types.h> #include <sys/disklabel.h> @@ -418,10 +419,39 @@ hf_storage_parse_conftxt (const char *conftxt) continue; } + /* XXX This is a hack, but we need to ignore dynamic labels like + * ufsids which are created and destroyed based on whether or not + * the actual device is mounted or not. If we don't then strange + * things happen in applications like nautilus. + */ + if ((! strcmp(fields[1], "LABEL") || + ! strcmp(fields[1], "BSD")) && + ! strncmp(fields[2], "ufsid/", strlen("ufsid/"))) + { + g_strfreev(fields); + continue; + } + geom_obj = g_new0(Geom_Object, 1); geom_obj->class = g_strdup(fields[1]); geom_obj->dev = g_strdup(fields[2]); + /* Allow for spaces in label names. */ + if (! strcmp(fields[1], "LABEL")) + { + int j; + + for (j = 3; g_strv_length(fields) > (j + 2) && + strcmp(fields[j + 2], "i"); j++) + { + char *tmp; + + tmp = g_strdup_printf("%s %s", geom_obj->dev, fields[j]); + g_free(geom_obj->dev); + geom_obj->dev = tmp; + } + } + geom_obj->type = -1; /* We use -1 here to denote a missing type. */ geom_obj->hash = hash; @@ -589,11 +619,16 @@ hf_storage_devd_notify (const char *system, char *conftxt; GSList *new_disks; - if (strcmp(system, "DEVFS") || strcmp(subsystem, "CDEV") || + if (! data || strcmp(system, "DEVFS") || strcmp(subsystem, "CDEV") || (strcmp(type, "CREATE") && strcmp(type, "DESTROY"))) return FALSE; + if (! strcmp(type, "DESTROY")) + g_usleep(G_USEC_PER_SEC/2); + conftxt = hf_get_string_sysctl(NULL, "kern.geom.conftxt"); + if (! conftxt) + return FALSE; new_disks = hf_storage_parse_conftxt(conftxt); g_free(conftxt); @@ -669,7 +704,7 @@ hf_storage_conftxt_timeout_cb (gpointer data) if (hf_is_waiting) return TRUE; - hf_storage_devd_notify("DEVFS", "CDEV", "CREATE", NULL); + hf_storage_devd_notify("DEVFS", "CDEV", "CREATE", ""); return TRUE; } diff --git a/hald/freebsd/hf-usb.c b/hald/freebsd/hf-usb.c index 280e0dbd..3f360871 100644 --- a/hald/freebsd/hf-usb.c +++ b/hald/freebsd/hf-usb.c @@ -32,8 +32,8 @@ #include <fcntl.h> #include <sys/ioctl.h> #include <unistd.h> -#if __FreeBSD_version < 800092 -#if __FreeBSD_version >= 800064 +#if (__FreeBSD_version < 800092) || (__FreeBSD_kernel_version < 800092) +#if (__FreeBSD_version >= 800064) || (__FreeBSD_kernel_version >= 800064) #include <legacy/dev/usb/usb.h> #else #include <dev/usb/usb.h> @@ -47,9 +47,9 @@ #include "hf-devtree.h" #include "hf-util.h" -#if __FreeBSD_version < 800092 +#if (__FreeBSD_version < 800092) || (__FreeBSD_kernel_version < 800092) #define HF_USB_DEVICE "/dev/usb" -#if __FreeBSD_version < 800066 +#if (__FreeBSD_version < 800066) || (__FreeBSD_kernel_version < 800066) #define HF_USB2_DEVICE "/dev/usb " #else #define HF_USB2_DEVICE "/dev/usbctl" diff --git a/hald/freebsd/hf-usb2.c b/hald/freebsd/hf-usb2.c index fff49e0a..301846f7 100644 --- a/hald/freebsd/hf-usb2.c +++ b/hald/freebsd/hf-usb2.c @@ -42,22 +42,6 @@ static struct libusb20_backend *hf_usb2_be = NULL; static void -hf_usb2_copy_parent (HalDevice *parent, - const char *key, - gpointer user_data) -{ - HalDevice *device; - - g_return_if_fail(HAL_IS_DEVICE(parent)); - g_return_if_fail(HAL_IS_DEVICE(user_data)); - - device = HAL_DEVICE(user_data); - - if (! strncmp(key, "usb_device.", strlen("usb_device."))) - hal_device_copy_property(parent, key, device, key); -} - -static void hf_usb2_probe_interfaces(HalDevice *parent) { int num_interfaces; @@ -79,9 +63,9 @@ hf_usb2_probe_interfaces(HalDevice *parent) hal_device_property_set_string(device, "info.subsystem", "usb"); hal_device_property_set_int(device, "usb.interface.number", i); - hal_device_property_foreach(parent, hf_usb2_copy_parent, device); hal_device_copy_property(parent, "info.product", device, "info.product"); hal_device_copy_property(parent, "info.vendor", device, "info.vendor"); + hal_device_merge_with_rewrite(device, parent, "usb.", "usb_device."); if (hf_device_preprobe(device)) { @@ -98,10 +82,10 @@ hf_usb2_probe_interfaces(HalDevice *parent) if (driver) { if (! strcmp(driver, "ukbd")) - hf_device_set_input(device, "keyboard", NULL); - else if (! strcmp(driver, "ums")) + hf_device_set_input(device, "keyboard", "keys", devname); + else if (! strcmp(driver, "ums") || ! strcmp(driver, "atp")) { - hf_device_set_input(device, "mouse", devname); + hf_device_set_input(device, "mouse", NULL, devname); hf_runner_run_sync(device, 0, "hald-probe-mouse", NULL); } else if (! strcmp(driver, "uhid")) @@ -192,11 +176,12 @@ hf_usb2_probe (void) addr = libusb20_dev_get_address(pdev); if (addr == 1) - parent = hf_devtree_find_parent_from_info(hald_get_gdl(), "usbus", bus); + parent = hf_devtree_find_from_info(hald_get_gdl(), "usbus", bus); else parent = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number", HAL_PROPERTY_TYPE_INT32, bus, "usb_device.port_number", - HAL_PROPERTY_TYPE_INT32, addr - 1, NULL); + HAL_PROPERTY_TYPE_INT32, addr - 1, "info.bus", + HAL_PROPERTY_TYPE_STRING, "usb_device", NULL); if (! parent || hal_device_property_get_bool(parent, "info.ignore")) continue; @@ -216,7 +201,13 @@ hf_usb2_devd_add (const char *name, HalDevice *parent_device; int bus, addr, pbus, paddr; - if (strncmp(name, "ugen", strlen("ugen"))) + if (! parent) + return FALSE; + + if (strncmp(name, "ugen", strlen("ugen")) && + ! strncmp(parent, "uhub", strlen("uhub"))) + return TRUE; + else if (strncmp(name, "ugen", strlen("ugen"))) return FALSE; else if (strncmp(parent, "ugen", strlen("ugen"))) return TRUE; @@ -232,7 +223,8 @@ hf_usb2_devd_add (const char *name, parent_device = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number", HAL_PROPERTY_TYPE_INT32, pbus, - "usb_device.port_number", HAL_PROPERTY_TYPE_INT32, paddr, NULL); + "usb_device.port_number", HAL_PROPERTY_TYPE_INT32, paddr, "info.bus", + HAL_PROPERTY_TYPE_STRING, "usb_device", NULL); if (parent_device && ! hal_device_property_get_bool(parent_device, "info.ignore")) @@ -255,8 +247,6 @@ hf_usb2_devd_remove (const char *name, if (strncmp(name, "ugen", strlen("ugen"))) return FALSE; - else if (strncmp(parent, "ugen", strlen("ugen"))) - return TRUE; if (sscanf(name, "ugen%i.%i", &bus, &addr) != 2) return FALSE; @@ -265,7 +255,8 @@ hf_usb2_devd_remove (const char *name, device = hf_device_store_match(hald_get_gdl(), "usb_device.bus_number", HAL_PROPERTY_TYPE_INT32, bus, "usb_device.port_number", - HAL_PROPERTY_TYPE_INT32, addr, NULL); + HAL_PROPERTY_TYPE_INT32, addr, "info.bus", + HAL_PROPERTY_TYPE_STRING, "usb_device", NULL); if (device) { @@ -276,6 +267,23 @@ hf_usb2_devd_remove (const char *name, return FALSE; } +static gboolean +hf_usb2_devd_notify (const char *system, + const char *subsystem, + const char *type, + const char *data) +{ + if (! data || strcmp(system, "DEVFS") || strcmp(subsystem, "CDEV") || + (strcmp(type, "CREATE") && strcmp(type, "DESTROY"))) + return FALSE; + + if (! strncmp(data, "cdev=ugen", strlen("cdev=ugen")) || + ! strncmp(data, "cdev=usb", strlen("cdev=usb"))) + return TRUE; + + return FALSE; +} + HFHandler hf_usb2_handler = { .privileged_init = hf_usb2_privileged_init, .probe = hf_usb2_probe @@ -283,5 +291,6 @@ HFHandler hf_usb2_handler = { HFDevdHandler hf_usb2_devd_handler = { .add = hf_usb2_devd_add, - .remove = hf_usb2_devd_remove + .remove = hf_usb2_devd_remove, + .notify = hf_usb2_devd_notify }; diff --git a/hald/freebsd/hf-volume.c b/hald/freebsd/hf-volume.c index 249d2bd1..07cf8050 100644 --- a/hald/freebsd/hf-volume.c +++ b/hald/freebsd/hf-volume.c @@ -86,9 +86,12 @@ hf_volume_resolve_fuse (const char *special) { if (strcmp(fields[0], special) == 0) { + char *ret; + + ret = g_strdup(fields[1]); g_strfreev(fields); g_strfreev(lines); - return g_strdup(fields[1]); + return ret; } } g_strfreev(fields); diff --git a/hald/freebsd/probing/Makefile.am b/hald/freebsd/probing/Makefile.am index 3e439b5f..67b8dcf5 100644 --- a/hald/freebsd/probing/Makefile.am +++ b/hald/freebsd/probing/Makefile.am @@ -67,5 +67,5 @@ hald_probe_volume_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@ @VOLUME_ID_CFLAGS@ hald_probe_volume_LDADD = \ @GLIB_LIBS@ \ @VOLUME_ID_LIBS@ \ - -lufs \ + @LIBUFS_LIBS@ \ $(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la diff --git a/hald/freebsd/probing/probe-hiddev.c b/hald/freebsd/probing/probe-hiddev.c index f0c598b3..054b159c 100644 --- a/hald/freebsd/probing/probe-hiddev.c +++ b/hald/freebsd/probing/probe-hiddev.c @@ -34,7 +34,7 @@ #include <dev/usb/usb.h> #include <dev/usb/usbhid.h> #else -#if __FreeBSD_version >= 800064 +#if (__FreeBSD_version >= 800064) || (__FreeBSD_kernel_version >= 800064) #include <dev/usb/usbhid.h> #else #include <dev/usb2/include/usb2_hid.h> diff --git a/hald/freebsd/probing/probe-usb2-device.c b/hald/freebsd/probing/probe-usb2-device.c index 129a1b1f..8a3596a4 100644 --- a/hald/freebsd/probing/probe-usb2-device.c +++ b/hald/freebsd/probing/probe-usb2-device.c @@ -34,7 +34,7 @@ #include <libusb20_desc.h> #include <libusb20.h> -#if __FreeBSD_version >= 800064 +#if (__FreeBSD_version >= 800064) || (__FreeBSD_kernel_version >= 800064) #include <dev/usb/usb_ioctl.h> #else #include <dev/usb2/include/usb2_standard.h> @@ -73,7 +73,7 @@ main(int argc, char **argv) { struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; struct LIBUSB20_CONFIG_DESC_DECODED *cdesc; -#if __FreeBSD_version >= 800092 +#if (__FreeBSD_version >= 800092) || (__FreeBSD_kernel_version >= 800092) struct usb_device_info di; #else struct usb2_device_info di; diff --git a/hald/freebsd/probing/probe-usb2-interface.c b/hald/freebsd/probing/probe-usb2-interface.c index f57bb77a..9c0523a7 100644 --- a/hald/freebsd/probing/probe-usb2-interface.c +++ b/hald/freebsd/probing/probe-usb2-interface.c @@ -34,7 +34,7 @@ #include <libusb20_desc.h> #include <libusb20.h> -#if __FreeBSD_version >= 800064 +#if (__FreeBSD_version >= 800064) || (__FreeBSD_kernel_version >= 800064) #include <dev/usb/usb_ioctl.h> #else #include <dev/usb2/include/usb2_standard.h> @@ -58,11 +58,11 @@ main(int argc, char **argv) if (pbe == NULL) goto end; - busstr = getenv("HAL_PROP_USB_DEVICE_BUS_NUMBER"); + busstr = getenv("HAL_PROP_USB_BUS_NUMBER"); if (! busstr) goto end; - addrstr = getenv("HAL_PROP_USB_DEVICE_PORT_NUMBER"); + addrstr = getenv("HAL_PROP_USB_PORT_NUMBER"); if (! addrstr) goto end; diff --git a/hald/freebsd/probing/probe-volume.c b/hald/freebsd/probing/probe-volume.c index 73e03182..9c8abde4 100644 --- a/hald/freebsd/probing/probe-volume.c +++ b/hald/freebsd/probing/probe-volume.c @@ -38,10 +38,12 @@ #include <sys/param.h> #include <sys/mount.h> #include <sys/types.h> +#ifdef HAVE_LIBUFS #include <ufs/ufs/ufsmount.h> #include <ufs/ufs/dinode.h> #include <ufs/ffs/fs.h> #include <libufs.h> +#endif /* HAVE_LIBUFS */ #include <isofs/cd9660/iso.h> #include <glib.h> #include <libvolume_id.h> @@ -561,6 +563,7 @@ main (int argc, char **argv) libhal_device_set_property_bool(hfp_ctx, hfp_udi, "volume.ignore", has_children || is_swap, &hfp_error); +#ifdef HAVE_LIBUFS if (vid && ! strcmp (vid->type, "ufs")) { struct uufsd ufsdisk; @@ -574,6 +577,7 @@ main (int argc, char **argv) snprintf(ufsid, sizeof(ufsid), "%08x%08x", ufsdisk.d_fs.fs_id[0], ufsdisk.d_fs.fs_id[1]); libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.freebsd.ufsid", ufsid, &hfp_error); + dbus_error_free(&hfp_error); ufs_devs = libhal_manager_find_device_string_match(hfp_ctx, "volume.freebsd.ufsid", ufsid, @@ -582,16 +586,17 @@ main (int argc, char **argv) dbus_error_free(&hfp_error); for (i = 0; i < num_udis; i++) { - if (ufs_devs[i] != NULL) + if (ufs_devs[i] != NULL && strcmp(ufs_devs[i], hfp_udi)) { gboolean mounted; mounted = libhal_device_get_property_bool(hfp_ctx, ufs_devs[i], "volume.is_mounted", &hfp_error); - dbus_error_free(&hfp_error); + dbus_error_free(&hfp_error); if (mounted) - { + { libhal_device_set_property_bool(hfp_ctx, hfp_udi, "volume.ignore", TRUE, &hfp_error); dbus_error_free(&hfp_error); + break; } } } @@ -600,6 +605,7 @@ main (int argc, char **argv) ufs_disk_close(&ufsdisk); } } +#endif /* HAVE_LIBUFS */ if (has_children) usage = "partitiontable"; diff --git a/hald/haldaemon.in b/hald/haldaemon.in index cd6dfde4..33ee31a5 100755 --- a/hald/haldaemon.in +++ b/hald/haldaemon.in @@ -12,7 +12,7 @@ # # Sanity checks. -[ -x @sbindir@/hald ] || exit 0 +[ -x @sbindir@/hald ] || exit 1 # Source function library. . @sysconfdir@/rc.d/init.d/functions diff --git a/hald/linux/device.c b/hald/linux/device.c index 824046cf..6ee20b86 100644 --- a/hald/linux/device.c +++ b/hald/linux/device.c @@ -1119,12 +1119,12 @@ input_test_abs (HalDevice *d, const char *sysfs_path) { num_bits_key = input_str_to_bitmask (s, bitmask_key, sizeof (bitmask_key)); - if (test_bit (BTN_STYLUS, bitmask_key)) { + if (test_bit (BTN_STYLUS, bitmask_key) || test_bit (BTN_TOOL_PEN, bitmask_key)) { hal_device_add_capability (d, "input.tablet"); goto out; } - if (test_bit (BTN_TOUCH, bitmask_key)) { + if (test_bit (BTN_TOOL_FINGER, bitmask_key) && !test_bit (BTN_TOOL_PEN, bitmask_key)) { hal_device_add_capability (d, "input.touchpad"); goto out; } @@ -1143,11 +1143,6 @@ input_test_abs (HalDevice *d, const char *sysfs_path) goto out; } } - - if (test_bit (ABS_PRESSURE, bitmask_abs)) { - hal_device_add_capability (d, "input.touchpad"); - goto out; - } } out: ; diff --git a/hald/linux/probing/probe-input.c b/hald/linux/probing/probe-input.c index 94e9929b..cad47d30 100644 --- a/hald/linux/probing/probe-input.c +++ b/hald/linux/probing/probe-input.c @@ -70,6 +70,7 @@ main (int argc, char *argv[]) fd = -1; setup_logger (); + dbus_error_init (&error); button_type = getenv ("HAL_PROP_BUTTON_TYPE"); if (button_type == NULL) @@ -96,7 +97,6 @@ main (int argc, char *argv[]) if (udi == NULL) goto out; - dbus_error_init (&error); if ((ctx = libhal_ctx_init_direct (&error)) == NULL) goto out; diff --git a/hald/util.h b/hald/util.h index c2a1584b..7883333c 100644 --- a/hald/util.h +++ b/hald/util.h @@ -38,7 +38,7 @@ #endif #define HAL_NAME_MAX 256 -#define HAL_PATH_MAX 512 +#define HAL_PATH_MAX 4096 gboolean hal_util_remove_trailing_slash (gchar *path); |