summaryrefslogtreecommitdiffstats
path: root/source/l/hal/patches
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/hal/patches')
-rw-r--r--source/l/hal/patches/10-keymap.fdi-restore_zap.diff62
-rw-r--r--source/l/hal/patches/allow_uid_gid_ntfs.diff20
-rw-r--r--source/l/hal/patches/check_udi_properly.diff41
-rw-r--r--source/l/hal/patches/fix_led_crash.diff26
-rw-r--r--source/l/hal/patches/fix_md_crash.diff45
-rw-r--r--source/l/hal/patches/fix_segfault_in_mdraid.diff36
-rw-r--r--source/l/hal/patches/fixup_udi_strings.diff69
-rw-r--r--source/l/hal/patches/hide_more_invalid_partitions.diff66
-rw-r--r--source/l/hal/patches/ignore_dupe_add_events.diff40
-rw-r--r--source/l/hal/patches/regen_fdi_cache_if_zero_size.diff24
-rw-r--r--source/l/hal/patches/set_X_keymap_properly.diff96
-rw-r--r--source/l/hal/patches/use_udevadm_not_udevinfo.patch36
12 files changed, 561 insertions, 0 deletions
diff --git a/source/l/hal/patches/10-keymap.fdi-restore_zap.diff b/source/l/hal/patches/10-keymap.fdi-restore_zap.diff
new file mode 100644
index 000000000..5958aae2b
--- /dev/null
+++ b/source/l/hal/patches/10-keymap.fdi-restore_zap.diff
@@ -0,0 +1,62 @@
+diff -Nur hal-0.5.11.orig/fdi/policy/10osvendor/10-keymap.fdi hal-0.5.11/fdi/policy/10osvendor/10-keymap.fdi
+--- hal-0.5.11.orig/fdi/policy/10osvendor/10-keymap.fdi 2008-05-07 18:21:16.000000000 -0500
++++ hal-0.5.11/fdi/policy/10osvendor/10-keymap.fdi 2009-07-21 00:06:11.779152226 -0500
+@@ -1,4 +1,8 @@
+ <?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
++
++<!-- DO NOT EDIT THIS FILE - IT WILL BE OVERWRITTEN ON UPGRADES.
++ SEE THE "READ THIS" NOTE BELOW FOR INSTRUCTIONS -->
++
+ <deviceinfo version="0.2">
+ <device>
+ <match key="info.capabilities" contains="input.keymap">
+@@ -6,18 +10,41 @@
+ </match>
+
+ <match key="info.capabilities" contains="input.keys">
+- <merge key="input.xkb.rules" type="string">base</merge>
+
+- <!-- If we're using Linux, we use evdev by default (falling back to
+- keyboard otherwise). -->
+- <merge key="input.xkb.model" type="string">keyboard</merge>
+- <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+- string="Linux">
+- <merge key="input.xkb.model" type="string">evdev</merge>
+- </match>
++ <!-- Restore Ctrl-Alt-Bksp Xserver Zapping -->
++ <merge key="input.xkb.options" type="string">terminate:ctrl_alt_bksp</merge>
+
++ <!-- Edit (as needed) these four lines in the copied fdi file -->
++ <merge key="input.xkb.rules" type="string">base</merge>
++ <merge key="input.xkb.model" type="string">evdev</merge>
+ <merge key="input.xkb.layout" type="string">us</merge>
+ <merge key="input.xkb.variant" type="string" />
++
+ </match>
+ </device>
+ </deviceinfo>
++
++<!-- READ THIS FOR CUSTOM KEYBOARD INFORMATION
++
++ If you want to add a custom model/layout/variant to X, you will need to COPY
++ this file to /etc/hal/fdi/policy/ and edit that copy. After editing it to
++ suit, you will need to leave X, restart the HAL daemon, and start X again.
++
++ Here's an example of the four lines from above:
++ <merge key="input.xkb.rules" type="string">base</merge>
++ <merge key="input.xkb.model" type="string">evdev</merge>
++ <merge key="input.xkb.layout" type="string">us</merge>
++ <merge key="input.xkb.variant" type="string">intl</merge>
++
++ Many desktop environments, including KDE and Xfce, have their own methods to
++ configure keyboard layouts and such if you'd like to use them.
++
++ If you prefer to use the "old" way of configuring keyboards (without HAL's
++ input device hotplugging), then you'll need to add the following lines to
++ the ServerFlags section of /etc/X11/xorg.conf:
++ Option "AllowEmptyInput" "false"
++ Option "AutoAddDevices" "false"
++ Option "AutoEnableDevices" "false"
++ You can now edit the Keyboard section of xorg.conf as usual.
++-->
++
diff --git a/source/l/hal/patches/allow_uid_gid_ntfs.diff b/source/l/hal/patches/allow_uid_gid_ntfs.diff
new file mode 100644
index 000000000..0997fff8a
--- /dev/null
+++ b/source/l/hal/patches/allow_uid_gid_ntfs.diff
@@ -0,0 +1,20 @@
+Author: Michael Biebl <biebl@debian.org>
+Date: Mon Nov 10 13:33:48 2008 +0100
+
+ allow uid/gid mount option for ntfs
+
+ Allow uid/gid mount option for ntfs, as reported in
+ http://bugs.debian.org/427109.
+
+diff -Nur hal-0.5.11.orig/tools/hal-storage-mount.c hal-0.5.11/tools/hal-storage-mount.c
+--- hal-0.5.11.orig/tools/hal-storage-mount.c 2008-05-07 18:24:23.000000000 -0500
++++ hal-0.5.11/tools/hal-storage-mount.c 2009-07-16 16:13:12.544551085 -0500
+@@ -720,6 +720,8 @@
+ * (since these doesn't contain uid/gid bits)
+ */
+ if (strcmp (libhal_volume_get_fstype (volume), "vfat") != 0 &&
++ strcmp (libhal_volume_get_fstype (volume), "ntfs") != 0 &&
++ strcmp (libhal_volume_get_fstype (volume), "ntfs-3g") != 0 &&
+ strcmp (libhal_volume_get_fstype (volume), "iso9660") != 0 &&
+ strcmp (libhal_volume_get_fstype (volume), "hfs") != 0 &&
+ strcmp (libhal_volume_get_fstype (volume), "udf") != 0) {
diff --git a/source/l/hal/patches/check_udi_properly.diff b/source/l/hal/patches/check_udi_properly.diff
new file mode 100644
index 000000000..cd474abc5
--- /dev/null
+++ b/source/l/hal/patches/check_udi_properly.diff
@@ -0,0 +1,41 @@
+Author: Richard Hughes <richard@hughsie.com>
+Date: Thu Jan 29 08:33:00 2009 +0000
+
+ check udi in hal-get-property
+
+ We are not checking if a UDI is valid in hal-get-property
+ which means getting a horrible DBUS error if the entry
+ is not a valid DBUS path.
+
+diff --git a/tools/hal_get_property.c b/tools/hal_get_property.c
+index ecaa6ce..d31261a 100644
+--- a/tools/hal_get_property.c
++++ b/tools/hal_get_property.c
+@@ -84,6 +84,7 @@ main (int argc, char *argv[])
+ dbus_bool_t is_hex = FALSE;
+ dbus_bool_t is_verbose = FALSE;
+ dbus_bool_t is_version = FALSE;
++ dbus_bool_t udi_exists;
+ char *str;
+ DBusError error;
+
+@@ -168,6 +169,19 @@ main (int argc, char *argv[])
+ return 1;
+ }
+
++ /* check UDI exists */
++ udi_exists = libhal_device_exists (hal_ctx, udi, &error);
++ if (!udi_exists) {
++ fprintf (stderr, "error: UDI %s does not exist\n", udi);
++ return 1;
++ }
++ if (dbus_error_is_set(&error)) {
++ fprintf (stderr, "error: libhal_device_exists: %s: %s\n", error.name, error.message);
++ LIBHAL_FREE_DBUS_ERROR (&error);
++ return 1;
++ }
++
++ /* get type */
+ type = libhal_device_get_property_type (hal_ctx, udi, key, &error);
+ if (type == LIBHAL_PROPERTY_TYPE_INVALID) {
+ fprintf (stderr, "error: libhal_device_get_property_type: %s: %s\n", error.name, error.message);
diff --git a/source/l/hal/patches/fix_led_crash.diff b/source/l/hal/patches/fix_led_crash.diff
new file mode 100644
index 000000000..3b50bbca4
--- /dev/null
+++ b/source/l/hal/patches/fix_led_crash.diff
@@ -0,0 +1,26 @@
+commit aec7c567419a1b8c33be1d08f962eea31a53e317
+Author: Andrey Borzenkov <arvidjaar@mail.ru>
+Date: Tue Jul 14 21:34:07 2009 +0200
+
+ work aroud crash caused by LED device handling
+
+ During suspend led device is removed; during resume it is recreated.
+ Apparently removing led device cause hald-addon- leds to exit
+ (thus disconnecting D-Bus connection); and sometimes next "add" event
+ comes too early, before hald had chance to notice missing addon.
+
+ Adds extra check to hald_singleton_device_added() to ensure we do not
+ abort on disconnected D-Bus connection.
+
+diff -Nur hal-0.5.11.orig/hald/hald_dbus.c hal-0.5.11/hald/hald_dbus.c
+--- hal-0.5.11.orig/hald/hald_dbus.c 2008-05-07 18:23:29.000000000 -0500
++++ hal-0.5.11/hald/hald_dbus.c 2009-07-16 16:19:04.629624258 -0500
+@@ -3432,7 +3432,7 @@
+ if (dbus_connection_send_with_reply (connection,
+ message,
+ &pending_call,
+- /*-1*/ 8000)) {
++ /*-1*/ 8000) && pending_call) {
+ /*HAL_INFO (("connection=%x message=%x", connection, message));*/
+ dbus_pending_call_set_notify (pending_call,
+ reply_from_singleton_device_changed,
diff --git a/source/l/hal/patches/fix_md_crash.diff b/source/l/hal/patches/fix_md_crash.diff
new file mode 100644
index 000000000..8a404c77f
--- /dev/null
+++ b/source/l/hal/patches/fix_md_crash.diff
@@ -0,0 +1,45 @@
+Backported from b35bf1fbfc000749010a27f3f35a95ddf6bb0b07 Mon Sep 17 00:00:00 2001
+From: Chris Coulson <chrisccoulson@googlemail.com>
+Subject: fix crash when assembling certain MD devices
+
+Don't assume that the parent of a volume has storage capability; e. g.
+if we are an MD partition then this is the case as we were re-parented
+to the root computer device object earlier.
+
+FD#21603
+
+--- a/hald/linux/blockdev.c 2008-05-08 01:23:41.000000000 +0200
++++ b/hald/linux/blockdev.c 2009-06-04 12:48:31.000000000 +0200
+@@ -1392,10 +1392,15 @@ hotplug_event_begin_add_blockdev (const
+ hal_device_property_set_bool (d, "volume.is_mounted", FALSE);
+ hal_device_property_set_bool (d, "volume.is_mounted_read_only", FALSE);
+ hal_device_property_set_bool (d, "volume.linux.is_device_mapper", is_device_mapper);
+- hal_device_property_set_bool (
+- d, "volume.is_disc",
+- strcmp (hal_device_property_get_string (parent, "storage.drive_type"), "cdrom") == 0);
+-
++ /* Don't assume that the parent has storage capability, eg
++ * if we are an MD partition then this is the case as we were
++ * re-parented to the root computer device object earlier.
++ */
++ if (hal_device_has_property(parent, "storage.drive_type")) {
++ hal_device_property_set_bool (d, "volume.is_disc", strcmp (hal_device_property_get_string (parent, "storage.drive_type"), "cdrom") == 0);
++ } else {
++ hal_device_property_set_bool (d, "volume.is_disc", FALSE);
++ }
+
+ is_physical_partition = TRUE;
+ if (is_fakevolume || is_device_mapper)
+@@ -1404,8 +1409,10 @@ hotplug_event_begin_add_blockdev (const
+ hal_device_property_set_bool (d, "volume.is_partition", is_physical_partition);
+
+ hal_device_property_set_string (d, "info.category", "volume");
+- if (strcmp(hal_device_property_get_string (parent, "storage.drive_type"), "cdrom") == 0) {
+- hal_device_add_capability (d, "volume.disc");
++ if (hal_device_has_property(parent, "storage.drive_type")) {
++ if (strcmp(hal_device_property_get_string (parent, "storage.drive_type"), "cdrom") == 0) {
++ hal_device_add_capability (d, "volume.disc");
++ }
+ }
+ hal_device_add_capability (d, "volume");
+ hal_device_add_capability (d, "block");
diff --git a/source/l/hal/patches/fix_segfault_in_mdraid.diff b/source/l/hal/patches/fix_segfault_in_mdraid.diff
new file mode 100644
index 000000000..88e5eaf63
--- /dev/null
+++ b/source/l/hal/patches/fix_segfault_in_mdraid.diff
@@ -0,0 +1,36 @@
+Author: Martin Poole <mpoole@redhat.com>
+Date: Wed Jul 29 14:20:45 2009 +0100
+
+ Fix a segfault in the mdraid code -- see rh#507782 for more info
+
+ Signed-off-by: Richard Hughes <richard@hughsie.com>
+
+diff -Nur hal-0.5.11.orig/hald/linux/blockdev.c hal-0.5.11/hald/linux/blockdev.c
+--- hal-0.5.11.orig/hald/linux/blockdev.c 2008-05-07 18:23:41.000000000 -0500
++++ hal-0.5.11/hald/linux/blockdev.c 2009-07-30 16:22:40.624837902 -0500
+@@ -851,7 +851,7 @@
+ }
+
+
+-void
++
+ hotplug_event_begin_add_blockdev (const gchar *sysfs_path, const gchar *device_file, gboolean is_partition,
+ HalDevice *parent, void *end_token)
+ {
+@@ -865,6 +865,7 @@
+ gboolean is_device_mapper;
+ gboolean is_md_device;
+ int md_number;
++ char tc;
+
+ is_device_mapper = FALSE;
+ is_fakevolume = FALSE;
+@@ -882,7 +883,7 @@
+ HAL_INFO (("Handling %s as fakevolume - sysfs_path_real=%s", device_file, sysfs_path_real));
+ is_fakevolume = TRUE;
+ sysfs_path_real = hal_util_get_parent_path (sysfs_path);
+- } else if (sscanf (hal_util_get_last_element (sysfs_path), "md%d", &md_number) == 1) {
++ } else if (sscanf (hal_util_get_last_element (sysfs_path), "md%d%c", &md_number, &tc) == 1) {
+ HAL_INFO (("Handling %s as MD device", device_file));
+ is_md_device = TRUE;
+ sysfs_path_real = g_strdup (sysfs_path);
diff --git a/source/l/hal/patches/fixup_udi_strings.diff b/source/l/hal/patches/fixup_udi_strings.diff
new file mode 100644
index 000000000..03549ec1d
--- /dev/null
+++ b/source/l/hal/patches/fixup_udi_strings.diff
@@ -0,0 +1,69 @@
+Author: Danny Kukawka <danny.kukawka@web.de>
+Date: Mon Oct 13 12:55:48 2008 +0200
+
+ fix udi: replace '/' in the last part of the udi
+
+ Fixed udi handling. DBus forbids a '/' after the base path
+ (in case of HAL: '/org/freedesktop/Hal/devices/) of a DBus
+ path. Replace all not allowed chars in the last part of the
+ UDI (everything but _a-zA-Z0-9) with a '_'.
+
+ This fixes also fd.o#16040.
+
+diff --git a/hald/hald.c b/hald/hald.c
+index a28d22e..051b33b 100644
+--- a/hald/hald.c
++++ b/hald/hald.c
+@@ -265,6 +265,8 @@ hald_compute_udi (gchar *dst, gsize dstsize, const gchar *format, ...)
+ hal_util_compute_udi_valist (hald_get_gdl (), dst, dstsize, format, args);
+ va_end (args);
+
++ hal_util_validate_udi (dst, dstsize);
++
+ if (hal_device_store_find (hald_get_gdl (), dst) == NULL &&
+ hal_device_store_find (hald_get_tdl (), dst) == NULL)
+ goto out;
+diff --git a/hald/util.c b/hald/util.c
+index 901e64f..81060e4 100644
+--- a/hald/util.c
++++ b/hald/util.c
+@@ -422,6 +422,26 @@ hal_util_compute_udi (HalDeviceStore *store, gchar *dst, gsize dstsize, const gc
+ va_end (args);
+ }
+
++void
++hal_util_validate_udi (gchar *udi, gsize size) {
++
++ char end[size];
++
++ if (sscanf (udi, "/org/freedesktop/Hal/devices/%s", end) == 1) {
++ if (strstr(end, "/") != NULL) {
++ HAL_DEBUG (("UDI end contains invalid char '/': '%s'", udi));
++
++ g_strcanon (end, "_"
++ "abcdefghijklmnopqrstuvwxyz"
++ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
++ "1234567890", '_');
++ g_snprintf (udi, size, "/org/freedesktop/Hal/devices/%s", end);
++
++ HAL_DEBUG (("Fixed UDI, replaced '/', new UDI: %s", udi));
++ }
++ }
++}
++
+
+ gboolean
+ hal_util_path_ascend (gchar *path)
+diff --git a/hald/util.h b/hald/util.h
+index 510c36c..5377e35 100644
+--- a/hald/util.h
++++ b/hald/util.h
+@@ -70,6 +70,8 @@ void hal_util_compute_udi_valist (HalDeviceStore *store, gchar *dst, gsize dstsi
+
+ void hal_util_compute_udi (HalDeviceStore *store, gchar *dst, gsize dstsize, const gchar *format, ...);
+
++void hal_util_validate_udi (gchar *udi, gsize size);
++
+ gboolean hal_util_path_ascend (gchar *path);
+
+ void hal_util_grep_discard_existing_data (void);
diff --git a/source/l/hal/patches/hide_more_invalid_partitions.diff b/source/l/hal/patches/hide_more_invalid_partitions.diff
new file mode 100644
index 000000000..a4437d29a
--- /dev/null
+++ b/source/l/hal/patches/hide_more_invalid_partitions.diff
@@ -0,0 +1,66 @@
+Author: Danny Kukawka <danny.kukawka@web.de>
+Date: Sat Jul 18 11:18:53 2009 +0200
+
+ hide more MBR, bootstrap and other partitions from desktop
+
+ Hide more MBR, bootstrap and other partitions from desktop.
+ Info taken from DeviceKit-disk/udev.
+
+Author: Frederic Crozat <fcrozat@mandriva.com>
+Date: Fri Jul 24 15:11:41 2009 +0200
+
+ hide Windows recovery partitions on pre-installed Futjisu laptops
+
+ Hide Windows recovery partitions on pre-installed Futjisu laptops.
+
+diff -Nur hal-0.5.11.orig/fdi/policy/10osvendor/20-storage-methods.fdi hal-0.5.11/fdi/policy/10osvendor/20-storage-methods.fdi
+--- hal-0.5.11.orig/fdi/policy/10osvendor/20-storage-methods.fdi 2008-05-07 18:21:16.000000000 -0500
++++ hal-0.5.11/fdi/policy/10osvendor/20-storage-methods.fdi 2009-07-30 16:16:49.822172103 -0500
+@@ -130,6 +130,10 @@
+ <match key="volume.label" string="DellRestore">
+ <merge key="volume.ignore" type="bool">true</merge>
+ </match>
++ <!-- Fujitsu ships laptops with a recovery partitions -->
++ <match key="volume.label" string="WinRE">
++ <merge key="volume.ignore" type="bool">true</merge>
++ </match>
+ </match>
+
+ <!-- ASUS ships some desktop with a recovery partition -->
+@@ -146,6 +150,11 @@
+ <merge key="volume.ignore" type="bool">true</merge>
+ </match>
+ </match>
++ <match key="volume.partition.scheme" string="apm">
++ <match key="volume.partition.type" string_outof="Apple_Bootstrap">
++ <merge key="volume.ignore" type="bool">true</merge>
++ </match>
++ </match>
+
+ <!-- EFI firmware partitions -->
+ <match key="volume.fstype" string="vfat">
+@@ -154,6 +163,24 @@
+ </match>
+ </match>
+
++ <!-- ignore the following MBR partition types (EFI, hidden, etc.)
++ see http://www.win.tue.nl/~aeb/partitions/partition_types-1.html
++ -->
++ <match key="volume.partition.scheme" string="mbr">
++ <match key="volume.partition.type" string_outof="0x00;0x11;0x14;0x16;0x17;0x1b;0x1c;0x1e;0x27;0x3d;0x84;0x8d;0x90;0x91;0x92;0x93;0x97;0x98;0x9a;0x9b;0xbb;0xc2;0xc3;0xdd;0xef">
++ <merge key="volume.ignore" type="bool">true</merge>
++ </match>
++ </match>
++
++ <!-- special GUID-identified partition types
++ see http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs
++ -->
++ <match key="volume.partition.scheme" string="gpt">
++ <match key="volume.partition.type" string_outof="C12A7328-F81F-11D2-BA4B-00A0C93EC93B;21686148-6449-6E6F-744E-656564454649">
++ <merge key="volume.ignore" type="bool">true</merge>
++ </match>
++ </match>
++
+ <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.Volume</append>
+
+ <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Mount</append>
diff --git a/source/l/hal/patches/ignore_dupe_add_events.diff b/source/l/hal/patches/ignore_dupe_add_events.diff
new file mode 100644
index 000000000..0056d8f96
--- /dev/null
+++ b/source/l/hal/patches/ignore_dupe_add_events.diff
@@ -0,0 +1,40 @@
+Author: Danny Kukawka <danny.kukawka@web.de>
+Date: Wed Mar 18 17:30:53 2009 +0100
+
+ ignore ADD events if there is already a device with same sysfs_path
+
+ Ignore ADD events if there is already a device with the same
+ syfs_path available in the GDL or TDL. This should prevent
+ problems getting duplicated devices from calling 'udevadm trigger'
+ (fd.o#18861) or from some other rare cases (see:
+ http://lists.freedesktop.org/archives/hal/2009-February/012954.html).
+
+ TODO: Check if it make sense to call a refresh for the already
+ existing device instead of ignoring the event completely.
+
+diff -Nur hal-0.5.11.orig/hald/linux/device.c hal-0.5.11/hald/linux/device.c
+--- hal-0.5.11.orig/hald/linux/device.c 2008-05-07 18:23:42.000000000 -0500
++++ hal-0.5.11/hald/linux/device.c 2009-07-16 16:21:36.619979288 -0500
+@@ -4423,11 +4423,22 @@
+ handler = dev_handlers[i];
+ if (strcmp (handler->subsystem, subsystem) == 0) {
+ HalDevice *d;
++ HalDevice *check;
+
+ if (strcmp (subsystem, "scsi") == 0)
+ if (missing_scsi_host (sysfs_path, (HotplugEvent *)end_token, HOTPLUG_ACTION_ADD))
+ goto out;
+
++ /* check if there is already a device with this sysfs_path in the system */
++ if ((check = hal_device_store_match_key_value_string (hald_get_gdl (), "linux.sysfs_path", sysfs_path)) != NULL ||
++ (check = hal_device_store_match_key_value_string (hald_get_tdl (), "linux.sysfs_path", sysfs_path)) != NULL) {
++ HAL_WARNING(("Have already a device with sysfs_path='%s' and udi='%s'. Ignore new add event for now.",
++ sysfs_path, hal_device_get_udi(check)));
++ /* maybe we should do a refresh on the found device ??? */
++ hotplug_event_end (end_token);
++ goto out;
++ }
++
+ /* attempt to add the device */
+ d = handler->add (sysfs_path, device_file, parent_dev, parent_path);
+ if (d == NULL) {
diff --git a/source/l/hal/patches/regen_fdi_cache_if_zero_size.diff b/source/l/hal/patches/regen_fdi_cache_if_zero_size.diff
new file mode 100644
index 000000000..ab3987488
--- /dev/null
+++ b/source/l/hal/patches/regen_fdi_cache_if_zero_size.diff
@@ -0,0 +1,24 @@
+Author: Richard Hughes <richard@hughsie.com>
+Date: Thu Mar 5 09:40:10 2009 +0000
+
+ regenerate cache if it's zero sized
+
+ Sometimes when systems go a bit haywire, the cache file is
+ written out as a zero byte file. We're still debugging this,
+ but in the case of a zero byte cache, just regenerate it anyway
+
+diff --git a/hald/mmap_cache.c b/hald/mmap_cache.c
+index 6125cf0..cc1ffa5 100644
+--- a/hald/mmap_cache.c
++++ b/hald/mmap_cache.c
+@@ -265,6 +265,10 @@ di_cache_coherency_check (gboolean setup_watches)
+ HAL_INFO(("Cache needs update"));
+ regen_cache();
+ did_regen = TRUE;
++ } else if (st.st_size == 0) {
++ HAL_INFO(("Cache zero size, so regenerating"));
++ regen_cache();
++ did_regen = TRUE;
+ }
+ } else {
+ regen_cache();
diff --git a/source/l/hal/patches/set_X_keymap_properly.diff b/source/l/hal/patches/set_X_keymap_properly.diff
new file mode 100644
index 000000000..933bcfa3f
--- /dev/null
+++ b/source/l/hal/patches/set_X_keymap_properly.diff
@@ -0,0 +1,96 @@
+diff --git a/tools/hal_set_property.c b/tools/hal_set_property.c
+index a99b059..3ab38bb 100644
+--- a/tools/hal_set_property.c
++++ b/tools/hal_set_property.c
+@@ -66,7 +66,7 @@ usage (int argc, char *argv[])
+ " (--int <value> | --string <value> | --bool <value> |\n"
+ " --strlist-pre <value> | --strlist-post <value> |\n"
+ " --strlist-rem <value> | --double <value> | --remove)\n"
+- " [--help] [--version]\n");
++ " [--direct] [--help] [--version]\n");
+ fprintf (stderr,
+ "\n" " --udi Unique Device Id\n"
+ " --key Key of the property to set\n"
+@@ -81,6 +81,7 @@ usage (int argc, char *argv[])
+ " --strlist-post Append a string to a list\n"
+ " --strlist-rem Remove a string from a list\n"
+ " --remove Indicates that the property should be removed\n"
++ " --direct Use direct HAL connection\n"
+ " --version Show version and exit\n"
+ " --help Show this information and exit\n"
+ "\n"
+@@ -114,6 +115,7 @@ main (int argc, char *argv[])
+ dbus_bool_t is_version = FALSE;
+ int type = PROP_INVALID;
+ DBusError error;
++ dbus_bool_t direct = FALSE;
+
+ if (argc <= 1) {
+ usage (argc, argv);
+@@ -135,6 +137,7 @@ main (int argc, char *argv[])
+ {"strlist-pre", 1, NULL, 0},
+ {"strlist-post", 1, NULL, 0},
+ {"strlist-rem", 1, NULL, 0},
++ {"direct", 0, NULL, 0},
+ {"remove", 0, NULL, 0},
+ {"version", 0, NULL, 0},
+ {"help", 0, NULL, 0},
+@@ -188,6 +191,8 @@ main (int argc, char *argv[])
+ type = PROP_STRLIST_REM;
+ } else if (strcmp (opt, "remove") == 0) {
+ remove = TRUE;
++ } else if (strcmp (opt, "direct") == 0) {
++ direct = TRUE;
+ } else if (strcmp (opt, "udi") == 0) {
+ udi = strdup (optarg);
+ } else if (strcmp (opt, "version") == 0) {
+@@ -215,24 +220,32 @@ main (int argc, char *argv[])
+
+ fprintf (stderr, "\n");
+
+- dbus_error_init (&error);
+- if ((hal_ctx = libhal_ctx_new ()) == NULL) {
+- fprintf (stderr, "error: libhal_ctx_new\n");
+- return 1;
+- }
+- if (!libhal_ctx_set_dbus_connection (hal_ctx, dbus_bus_get (DBUS_BUS_SYSTEM, &error))) {
+- fprintf (stderr, "error: libhal_ctx_set_dbus_connection: %s: %s\n", error.name, error.message);
+- LIBHAL_FREE_DBUS_ERROR (&error);
+- return 1;
+- }
+- if (!libhal_ctx_init (hal_ctx, &error)) {
+- if (dbus_error_is_set(&error)) {
+- fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+- dbus_error_free (&error);
++ dbus_error_init (&error);
++ if (direct) {
++ if ((hal_ctx = libhal_ctx_init_direct (&error)) == NULL) {
++ fprintf (stderr, "error: libhal_ctx_init_direct\n");
++ LIBHAL_FREE_DBUS_ERROR (&error);
++ return 1;
++ }
++ } else {
++ if ((hal_ctx = libhal_ctx_new ()) == NULL) {
++ fprintf (stderr, "error: libhal_ctx_new\n");
++ return 1;
++ }
++ if (!libhal_ctx_set_dbus_connection (hal_ctx, dbus_bus_get (DBUS_BUS_SYSTEM, &error))) {
++ fprintf (stderr, "error: libhal_ctx_set_dbus_connection: %s: %s\n", error.name, error.message);
++ LIBHAL_FREE_DBUS_ERROR (&error);
++ return 1;
++ }
++ if (!libhal_ctx_init (hal_ctx, &error)) {
++ if (dbus_error_is_set(&error)) {
++ fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
++ dbus_error_free (&error);
++ }
++ fprintf (stderr, "Could not initialise connection to hald.\n"
++ "Normally this means the HAL daemon (hald) is not running or not ready.\n");
++ return 1;
+ }
+- fprintf (stderr, "Could not initialise connection to hald.\n"
+- "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+- return 1;
+ }
+
+ if (remove) {
diff --git a/source/l/hal/patches/use_udevadm_not_udevinfo.patch b/source/l/hal/patches/use_udevadm_not_udevinfo.patch
new file mode 100644
index 000000000..09f709e0b
--- /dev/null
+++ b/source/l/hal/patches/use_udevadm_not_udevinfo.patch
@@ -0,0 +1,36 @@
+From: Danny Kukawka <danny.kukawka@web.de>
+Date: Wed, 27 Aug 2008 19:24:33 +0000 (+0200)
+Subject: use udevadm instead of (deprecated) udevinfo
+X-Git-Url: http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=f6af40c1e7ea54e6
+
+use udevadm instead of (deprecated) udevinfo
+
+Use udevadm instead of (deprecated) udevinfo. Adapted/fixed version
+of a patch contributed by Lucas Hazel <lucas@die.net.au> via HAL ML.
+
+diff -Nur hal-0.5.11.orig/hald/linux/blockdev.c hal-0.5.11/hald/linux/blockdev.c
+--- hal-0.5.11.orig/hald/linux/blockdev.c 2008-05-07 18:23:41.000000000 -0500
++++ hal-0.5.11/hald/linux/blockdev.c 2009-07-16 16:16:58.051983413 -0500
+@@ -1750,7 +1750,7 @@
+ char *ret;
+ char *u_stdout;
+ int u_exit_status;
+- const char *argv[] = {"/usr/bin/udevinfo", "--root", "--query", "name", "--path", NULL, NULL};
++ const char *argv[] = {"/sbin/udevadm", "info", "--root", "--query", "name", "--path", NULL, NULL};
+ GError *g_error;
+
+ ret = NULL;
+diff -Nur hal-0.5.11.orig/hald/linux/coldplug.c hal-0.5.11/hald/linux/coldplug.c
+--- hal-0.5.11.orig/hald/linux/coldplug.c 2008-05-07 18:23:32.000000000 -0500
++++ hal-0.5.11/hald/linux/coldplug.c 2009-07-16 16:16:58.051983413 -0500
+@@ -149,8 +149,8 @@
+ static gboolean
+ hal_util_init_sysfs_to_udev_map (void)
+ {
+- char *udevdb_export_argv[] = { "/usr/bin/udevinfo", "-e", NULL };
+- char *udevroot_argv[] = { "/usr/bin/udevinfo", "-r", NULL };
++ char *udevdb_export_argv[] = { "/sbin/udevadm", "info", "-e", NULL };
++ char *udevroot_argv[] = { "/sbin/udevadm", "info", "-r", NULL };
+ int udevinfo_exitcode;
+ UdevInfo *info = NULL;
+ char *p;