summaryrefslogtreecommitdiff
path: root/source/l/hal
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/hal')
-rw-r--r--source/l/hal/doinst.sh25
-rwxr-xr-xsource/l/hal/hal.SlackBuild153
-rw-r--r--source/l/hal/hal.conf69
-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
-rw-r--r--source/l/hal/rc.hald49
-rw-r--r--source/l/hal/slack-desc19
17 files changed, 876 insertions, 0 deletions
diff --git a/source/l/hal/doinst.sh b/source/l/hal/doinst.sh
new file mode 100644
index 00000000..ec123d59
--- /dev/null
+++ b/source/l/hal/doinst.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+# Keep same perms on rc.hald.new:
+if [ -e etc/rc.d/rc.hald ]; then
+ cp -a etc/rc.d/rc.hald etc/rc.d/rc.hald.new.incoming
+ cat etc/rc.d/rc.hald.new > etc/rc.d/rc.hald.new.incoming
+ mv etc/rc.d/rc.hald.new.incoming etc/rc.d/rc.hald.new
+fi
+
+config etc/rc.d/rc.hald.new
+config etc/dbus-1/system.d/hal.conf.new
+
diff --git a/source/l/hal/hal.SlackBuild b/source/l/hal/hal.SlackBuild
new file mode 100755
index 00000000..a797b252
--- /dev/null
+++ b/source/l/hal/hal.SlackBuild
@@ -0,0 +1,153 @@
+#!/bin/sh
+
+# Copyright 2007 Ole Andre Rodlie <olear@slackforge.net>
+# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=hal
+VERSION=0.5.11
+ARCH=${ARCH:-x86_64}
+BUILD=${BUILD:-6}
+
+NUMJOBS=${NUMJOBS:--j7}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PRGNAM
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+fi
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP || exit 1
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* || exit 1
+cd $PRGNAM-$VERSION || exit 1
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Restore Xorg's Zap'ing behavior by default and make it
+# clearer to the user how to edit and/or get back old behavior
+zcat $CWD/patches/10-keymap.fdi-restore_zap.diff.gz | patch -p1 || exit 1
+# Hide some invalid partition types
+zcat $CWD/patches/hide_more_invalid_partitions.diff.gz | patch -p1 || exit 1
+# Allow uid/gid options with ntfs-3g filesystems
+zcat $CWD/patches/allow_uid_gid_ntfs.diff.gz | patch -p1 || exit 1
+# Check UDI's properly so that we don't cause dbus errors
+zcat $CWD/patches/check_udi_properly.diff.gz | patch -p1 || exit 1
+# Prevent crash on newer kernels during resume operations
+zcat $CWD/patches/fix_led_crash.diff.gz | patch -p1 || exit 1
+# Fix a crash when assembling md devices
+zcat $CWD/patches/fix_md_crash.diff.gz | patch -p1 || exit 1
+# Fix another segfault in mdraid handling
+zcat $CWD/patches/fix_segfault_in_mdraid.diff.gz | patch -p1 || exit 1
+# Strip trailing "/" characters from UDI strings to prevent dbus errors
+zcat $CWD/patches/fixup_udi_strings.diff.gz | patch -p1 || exit 1
+# Ignore duplicate events (e.g. run udevadm trigger on a running system)
+zcat $CWD/patches/ignore_dupe_add_events.diff.gz | patch -p1 || exit 1
+# Use direct hal connection to set the X keymap
+zcat $CWD/patches/set_X_keymap_properly.diff.gz | patch -p1 || exit 1
+# Instead of dying, regenerate the fdi cache if it's zero-byte
+zcat $CWD/patches/regen_fdi_cache_if_zero_size.diff.gz | patch -p1 || exit 1
+# We need to use "udevadm info" now instead of "udevinfo"
+zcat $CWD/patches/use_udevadm_not_udevinfo.patch.gz | patch -p1 || exit 1
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --disable-static \
+ --enable-docbook-docs \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --with-pid-file=/var/run/hald/pid \
+ --enable-parted \
+ --disable-policy-kit \
+ --disable-console-kit \
+ --disable-acl-management \
+ --enable-umount-helper \
+ --enable-sonypic \
+ --build=$ARCH-slackware-linux \
+ || exit 1
+# These were merged into the 2.6.22 kernels
+# --enable-acpi-ibm --enable-acpi-toshiba
+
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+( cd $PKG/usr/man
+ find . -type f -exec gzip -9 {} \;
+ for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
+)
+
+# Let's put the udev rules in the right place
+mkdir -p $PKG/lib
+mv $PKG/etc/udev $PKG/lib
+
+# Install init script for hal
+mkdir -p $PKG/etc/rc.d
+zcat $CWD/rc.hald.gz > $PKG/etc/rc.d/rc.hald.new
+# Make HAL run by default:
+chmod 0755 $PKG/etc/rc.d/rc.hald.new
+
+# Make the HAL access controls suitable for us
+# Big thanks to Richard Hughes for feedback on this :-)
+# First, move the one installed by the system to the docs directory
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+mv $PKG/etc/dbus-1/system.d/hal.conf \
+ $PKG/usr/doc/$PRGNAM-$VERSION/hal.conf.orig
+# Don't clobber an existing config file in case custom changes have been made
+zcat $CWD/hal.conf.gz > $PKG/etc/dbus-1/system.d/hal.conf.new
+
+# Install docs (directory was created above)
+cp -a \
+ AUTHORS COPYING* HACKING INSTALL NEWS README* \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+( cd $PKG/usr/doc/$PRGNAM-$VERSION
+ ln -s ../../share/gtk-doc/html/libhal libhal
+ ln -s ../../share/gtk-doc/html/libhal-storage libhal-storage
+)
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PRGNAM-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/source/l/hal/hal.conf b/source/l/hal/hal.conf
new file mode 100644
index 00000000..03c75353
--- /dev/null
+++ b/source/l/hal/hal.conf
@@ -0,0 +1,69 @@
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- Only root or user haldaemon can own the HAL service -->
+ <policy user="haldaemon">
+ <allow own="org.freedesktop.Hal"/>
+ </policy>
+ <policy user="root">
+ <allow own="org.freedesktop.Hal"/>
+ </policy>
+
+ <policy context="default">
+ <!-- Allow anyone to invoke methods on the Introspectable interface -->
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.DBus.Introspectable"/>
+ <!-- Allow anyone to invoke methods on the Properties interface -->
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.DBus.Properties" />
+ <!-- Allow anyone to invoke methods on the Manager interface -->
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Manager"/>
+ <!-- Allow anyone to invoke methods on the Device interface -->
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device"/>
+ </policy>
+
+ <!-- Allow members of 'power' group to do power management stuff -->
+ <policy group="power">
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.CPUFreq"/>
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.KeyboardBacklight"/>
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.LightSensor"/>
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.DockStation"/>
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.Leds"/>
+ </policy>
+
+ <!-- Allow members of 'plugdev' group to mount/unmount volumes -->
+ <policy group="plugdev">
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.Storage"/>
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.Storage.Removable"/>
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.Volume"/>
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
+ </policy>
+
+ <!-- Allow members of netdev group to en/disable wake-on-lan in NICs
+ and to turn radios on and off -->
+ <policy group="netdev">
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.KillSwitch"/>
+ <allow send_destination="org.freedesktop.Hal"
+ send_interface="org.freedesktop.Hal.Device.WakeOnLan"/>
+ </policy>
+
+</busconfig>
+
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 00000000..5958aae2
--- /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 00000000..0997fff8
--- /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 00000000..cd474abc
--- /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 00000000..3b50bbca
--- /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 00000000..8a404c77
--- /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 00000000..88e5eaf6
--- /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 00000000..03549ec1
--- /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 00000000..a4437d29
--- /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 00000000..0056d8f9
--- /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 00000000..ab398748
--- /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 00000000..933bcfa3
--- /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 00000000..09f709e0
--- /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;
diff --git a/source/l/hal/rc.hald b/source/l/hal/rc.hald
new file mode 100644
index 00000000..7516de2b
--- /dev/null
+++ b/source/l/hal/rc.hald
@@ -0,0 +1,49 @@
+#!/bin/sh
+# Start/stop/restart the hal daemon:
+
+PIDFILE=/var/run/hald/pid
+
+hal_start() {
+ if [ -x /usr/sbin/hald ]; then
+ if ! ps axc | grep -q dbus-daemon ; then
+ if [ -r /etc/rc.d/rc.messagebus ]; then
+ sh /etc/rc.d/rc.messagebus start
+ sleep 1
+ else
+ echo "FATAL: Can't start HAL daemon without dbus package."
+ sleep 5
+ exit 1
+ fi
+ fi
+ echo "Starting HAL daemon: /usr/sbin/hald --daemon=yes"
+ /usr/sbin/hald --daemon=yes
+ fi
+}
+
+hal_stop() {
+ if [ -e "$PIDFILE" ]; then
+ kill $(cat $PIDFILE)
+ rm -f $PIDFILE
+ fi
+ # Just in case:
+ killall hald 1> /dev/null 2> /dev/null
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ hal_start
+ ;;
+ stop)
+ hal_stop
+ ;;
+ restart)
+ hal_stop
+ sleep 1
+ hal_start
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart}"
+ ;;
+esac
+
diff --git a/source/l/hal/slack-desc b/source/l/hal/slack-desc
new file mode 100644
index 00000000..c01fd8a6
--- /dev/null
+++ b/source/l/hal/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+hal: hal (The HAL Hardware Abstraction Layer)
+hal:
+hal: HAL is a piece of software that provides a view of the various
+hal: hardware attached to a system. HAL keeps detailed metadata for each
+hal: piece of hardware and provides hooks so that system and desktop
+hal: software can react to changes in the hardware configuration (such as
+hal: the insertion of a DVD, or a USB flash memory stick). Users in the
+hal: "plugdev" or "cdrom" group will be able to use such devices on the
+hal: desktop without the need to mount/umount them manually.
+hal:
+hal: For more info, see: http://hal.freedesktop.org/