diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2010-05-19 08:58:23 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 22:43:05 +0200 |
commit | b76270bf9e6dd375e495fec92140a79a79415d27 (patch) | |
tree | 3dbed78b2279bf9f14207a16dc634b90995cbd40 /source/l/hal | |
parent | 5a12e7c134274dba706667107d10d231517d3e05 (diff) | |
download | current-b76270bf9e6dd375e495fec92140a79a79415d27.tar.gz |
Slackware 13.1slackware-13.1
Wed May 19 08:58:23 UTC 2010
Slackware 13.1 x86_64 stable is released!
Lots of thanks are due -- see the RELEASE_NOTES and the rest of the
ChangeLog for credits. The ISOs are on their way to replication,
a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD.
We are taking pre-orders now at store.slackware.com, and offering
a discount if you sign up for a subscription. Consider picking up
a copy to help support the project. Thanks again to the Slackware
community for testing, contributing, and generally holding us to a
high level of quality. :-)
Enjoy!
Diffstat (limited to 'source/l/hal')
21 files changed, 507 insertions, 550 deletions
diff --git a/source/l/hal/doinst.sh b/source/l/hal/doinst.sh index ec123d59..a1c86cf4 100644 --- a/source/l/hal/doinst.sh +++ b/source/l/hal/doinst.sh @@ -1,5 +1,3 @@ -#!/bin/sh - config() { NEW="$1" OLD="$(dirname $NEW)/$(basename $NEW .new)" diff --git a/source/l/hal/hal.SlackBuild b/source/l/hal/hal.SlackBuild index a797b252..96713686 100755 --- a/source/l/hal/hal.SlackBuild +++ b/source/l/hal/hal.SlackBuild @@ -1,7 +1,7 @@ #!/bin/sh # Copyright 2007 Ole Andre Rodlie <olear@slackforge.net> -# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN +# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -21,34 +21,46 @@ # 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} +PKGNAM=hal +VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-2} NUMJOBS=${NUMJOBS:--j7} +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + CWD=$(pwd) TMP=${TMP:-/tmp} -PKG=$TMP/package-$PRGNAM +PKG=$TMP/package-$PKGNAM if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" -elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" 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 +rm -rf $PKGNAM-$VERSION +tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1 +cd $PKGNAM-$VERSION || exit 1 chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ @@ -56,43 +68,42 @@ find . \ \( -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 +# Restore the DontZap defaults from lore +zcat $CWD/patches/10-keymap.fdi-restore_zap.diff.gz | patch -p1 --verbose || exit 1 + +# Oops, a freebsd-specific commit wasn't :-) +zcat $CWD/patches/fix_libusb_detection.diff.gz | patch -p1 --verbose || exit 1 + +# Fix a segfault -- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562068 +zcat $CWD/patches/fix_segfault_in_LIBHAL_FREE_DBUS_ERROR.diff.gz | patch -p1 --verbose || exit 1 +# Increase PATH_HAL_MAX to 4096 to avoid crashes +# https://bugs.freedesktop.org/show_bug.cgi?id=25888 +zcat $CWD/patches/increase_HAL_PATH_MAX_to_4096.diff.gz | patch -p1 --verbose || exit 1 + +# Handle input.touchpad explicitly (needed due to kernel changes) +zcat $CWD/patches/handle_input.touchpad_explicitly.diff.gz | patch -p1 --verbose || exit 1 + +# Fix incorrect arguments to ioperm() +zcat $CWD/patches/fix_ioperm_arguments.patch.gz | patch -p1 --verbose || exit 1 + +# Fix segfaults from not calling dbus_error_init() early enough +zcat $CWD/patches/fix_segfault-dbus_error_init.patch.gz | patch -p1 --verbose || exit 1 + +autoconf CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ + --libexecdir=/usr/libexec \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ + --with-udev-prefix=/lib \ --disable-static \ --enable-docbook-docs \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ + --docdir=/usr/doc/$PKGNAM-$VERSION \ --with-pid-file=/var/run/hald/pid \ --enable-parted \ --disable-policy-kit \ @@ -104,6 +115,10 @@ CXXFLAGS="$SLKCFLAGS" \ || exit 1 # These were merged into the 2.6.22 kernels # --enable-acpi-ibm --enable-acpi-toshiba +# Use these instead of the corresponding --disable lines for PolicyKit support +# --enable-policy-kit \ +# --enable-console-kit \ +# --enable-acl-management \ make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 @@ -116,30 +131,28 @@ find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ 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 +# /* remove everything between the C-style comments if using PK # 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 +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION mv $PKG/etc/dbus-1/system.d/hal.conf \ - $PKG/usr/doc/$PRGNAM-$VERSION/hal.conf.orig + $PKG/usr/doc/$PKGNAM-$VERSION/hal.conf.orig +# end removal */ # 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 + $PKG/usr/doc/$PKGNAM-$VERSION +( cd $PKG/usr/doc/$PKGNAM-$VERSION ln -s ../../share/gtk-doc/html/libhal libhal ln -s ../../share/gtk-doc/html/libhal-storage libhal-storage ) @@ -149,5 +162,5 @@ 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 +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz diff --git a/source/l/hal/patches/10-keymap.fdi-restore_zap.diff b/source/l/hal/patches/10-keymap.fdi-restore_zap.diff index 5958aae2..12e21ba7 100644 --- a/source/l/hal/patches/10-keymap.fdi-restore_zap.diff +++ b/source/l/hal/patches/10-keymap.fdi-restore_zap.diff @@ -1,3 +1,8 @@ +We're going to make it clearer to users that they should NOT edit + this file (as installed to /usr/share/hal/fdi/... and also let + them know where to copy it and how to edit that copy for an + alternate keymap and such... --rworkman @ 20091211 + 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 diff --git a/source/l/hal/patches/allow_uid_gid_ntfs.diff b/source/l/hal/patches/allow_uid_gid_ntfs.diff deleted file mode 100644 index 0997fff8..00000000 --- a/source/l/hal/patches/allow_uid_gid_ntfs.diff +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index cd474abc..00000000 --- a/source/l/hal/patches/check_udi_properly.diff +++ /dev/null @@ -1,41 +0,0 @@ -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_ioperm_arguments.patch b/source/l/hal/patches/fix_ioperm_arguments.patch new file mode 100644 index 00000000..833e0756 --- /dev/null +++ b/source/l/hal/patches/fix_ioperm_arguments.patch @@ -0,0 +1,40 @@ +commit 597c1ffffd61a15a334ce42f2a569c59f0270bcb +Author: Dmitry Torokhov <dmitry.torokhov@gmail.com> +Date: Thu Feb 25 02:25:18 2010 -0800 + + Fix incorrect arguments to ioperm() call + + The second argument of ioperm() is not the last port to be accessed + but rather length of the port range [port, port + len). + + Signed-off-by: Dmitry Torokhov <dtor@mail.ru> + Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com> + +diff --git a/hald/linux/addons/addon-imac-backlight.c b/hald/linux/addons/addon-imac-backlight.c +index e869192..54e4ea3 100644 +--- a/hald/linux/addons/addon-imac-backlight.c ++++ b/hald/linux/addons/addon-imac-backlight.c +@@ -158,7 +158,8 @@ main (int argc, char **argv) + goto out; + } + +- if (ioperm(0xB2, 0xB3, 1) < 0) ++ /* Allow access to ports 0xB2 and 0xB3 */ ++ if (ioperm(0xB2, 2, 1) < 0) + { + HAL_ERROR (("ioperm failed (you should be root).")); + exit(1); +diff --git a/hald/linux/addons/addon-macbookpro-backlight.c b/hald/linux/addons/addon-macbookpro-backlight.c +index 2a6fef6..c1bbbac 100644 +--- a/hald/linux/addons/addon-macbookpro-backlight.c ++++ b/hald/linux/addons/addon-macbookpro-backlight.c +@@ -507,7 +507,8 @@ main (int argc, char *argv[]) + state = INREG(0x7ae4); + OUTREG(0x7ae4, state); + +- if (ioperm (0x300, 0x304, 1) < 0) { ++ /* Allow access to porta 0x300 through 0x304 */ ++ if (ioperm (0x300, 5, 1) < 0) { + HAL_ERROR (("ioperm failed (you should be root).")); + exit(1); + } diff --git a/source/l/hal/patches/fix_led_crash.diff b/source/l/hal/patches/fix_led_crash.diff deleted file mode 100644 index 3b50bbca..00000000 --- a/source/l/hal/patches/fix_led_crash.diff +++ /dev/null @@ -1,26 +0,0 @@ -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_libusb_detection.diff b/source/l/hal/patches/fix_libusb_detection.diff new file mode 100644 index 00000000..8a4637d4 --- /dev/null +++ b/source/l/hal/patches/fix_libusb_detection.diff @@ -0,0 +1,65 @@ +commit fce91df8ba7f305c624baf1f06961c040b088ecc +Author: Joe Marcus Clarke <marcus@FreeBSD.org> +Date: Mon Dec 7 19:05:27 2009 -0500 + + Fix libusb detection on Linux + + Adjust the FreeBSD libusb20 code so that it does not interfere with the + Linux libusb detection. + + Reported by: Robby Workman <rw@rlworkman.net> + +diff --git a/configure.in b/configure.in +index a8fda51..8363595 100644 +--- a/configure.in ++++ b/configure.in +@@ -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,25 @@ 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" ++ 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/source/l/hal/patches/fix_md_crash.diff b/source/l/hal/patches/fix_md_crash.diff deleted file mode 100644 index 8a404c77..00000000 --- a/source/l/hal/patches/fix_md_crash.diff +++ /dev/null @@ -1,45 +0,0 @@ -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-dbus_error_init.patch b/source/l/hal/patches/fix_segfault-dbus_error_init.patch new file mode 100644 index 00000000..f01eefca --- /dev/null +++ b/source/l/hal/patches/fix_segfault-dbus_error_init.patch @@ -0,0 +1,179 @@ +commit baa61a879985d63f549854518ef14efd40e62e8c +Author: Peter Jones <pjones@redhat.com> +Date: Wed Feb 24 11:19:28 2010 -0500 + + Make sure dbus_error_init() is called before LIBHAL_FREE_DBUS_ERROR() + + If dbus_error_init() is not called before LIBHAL_FREE_DBUS_ERROR() is + called on that error, then it is uninitialized and may segfault. This + means that dbus_error_init() must be called before any "goto out" if + "out:" calls LIBHAL_FREE_DBUS_ERROR(). + + Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com> + +diff --git a/hald/linux/probing/probe-hiddev.c b/hald/linux/probing/probe-hiddev.c +index 45d2084..bffc040 100644 +--- a/hald/linux/probing/probe-hiddev.c ++++ b/hald/linux/probing/probe-hiddev.c +@@ -57,11 +57,12 @@ main (int argc, char *argv[]) + /* assume failure */ + ret = 1; + ++ dbus_error_init (&error); ++ + udi = getenv ("UDI"); + if (udi == NULL) + goto out; + +- dbus_error_init (&error); + if ((ctx = libhal_ctx_init_direct (&error)) == NULL) + goto out; + +diff --git a/hald/linux/probing/probe-ieee1394-unit.c b/hald/linux/probing/probe-ieee1394-unit.c +index 70b0f86..aaa92e2 100644 +--- a/hald/linux/probing/probe-ieee1394-unit.c ++++ b/hald/linux/probing/probe-ieee1394-unit.c +@@ -388,6 +388,8 @@ int main (int argc, char *argv[]) + + setup_logger (); + ++ dbus_error_init (&error); ++ + udi = getenv ("UDI"); + if (udi == NULL) + goto out; +@@ -396,7 +398,6 @@ int main (int argc, char *argv[]) + if (ieee1394_udi == NULL) + goto out; + +- dbus_error_init (&error); + if ((ctx = libhal_ctx_init_direct (&error)) == NULL) + goto out; + +diff --git a/hald/linux/probing/probe-net-bluetooth.c b/hald/linux/probing/probe-net-bluetooth.c +index 0b1b912..e911eea 100644 +--- a/hald/linux/probing/probe-net-bluetooth.c ++++ b/hald/linux/probing/probe-net-bluetooth.c +@@ -141,6 +141,8 @@ main (int argc, char *argv[]) + DBusMessage *reply = NULL; + DBusError error; + ++ dbus_error_init (&error); ++ + udi = getenv ("UDI"); + if (udi == NULL) + goto out; +@@ -151,8 +153,6 @@ main (int argc, char *argv[]) + + HAL_INFO (("Investigating '%s'", iface)); + +- dbus_error_init (&error); +- + if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL) + goto out; + +diff --git a/hald/linux/probing/probe-printer.c b/hald/linux/probing/probe-printer.c +index 91ed7bc..7c6d1c6 100644 +--- a/hald/linux/probing/probe-printer.c ++++ b/hald/linux/probing/probe-printer.c +@@ -66,6 +66,8 @@ main (int argc, char *argv[]) + ret = 1; + + setup_logger (); ++ ++ dbus_error_init (&error); + + udi = getenv ("UDI"); + if (udi == NULL) { +@@ -73,7 +75,6 @@ main (int argc, char *argv[]) + goto out; + } + +- dbus_error_init (&error); + if ((ctx = libhal_ctx_init_direct (&error)) == NULL) { + HAL_ERROR (("ctx init failed")); + goto out; +diff --git a/hald/linux/probing/probe-smbios.c b/hald/linux/probing/probe-smbios.c +index 0bc9689..15c0d4f 100644 +--- a/hald/linux/probing/probe-smbios.c ++++ b/hald/linux/probing/probe-smbios.c +@@ -129,6 +129,8 @@ main (int argc, char *argv[]) + ret = 1; + + setup_logger (); ++ ++ dbus_error_init (&error); + + udi = getenv ("UDI"); + if (udi == NULL) { +@@ -136,7 +138,6 @@ main (int argc, char *argv[]) + goto out; + } + +- dbus_error_init (&error); + if ((ctx = libhal_ctx_init_direct (&error)) == NULL) { + HAL_ERROR (("ctx init failed")); + goto out; +diff --git a/hald/linux/probing/probe-storage.c b/hald/linux/probing/probe-storage.c +index 824a82e..dd524ca 100644 +--- a/hald/linux/probing/probe-storage.c ++++ b/hald/linux/probing/probe-storage.c +@@ -109,6 +109,8 @@ main (int argc, char *argv[]) + /* assume failure */ + ret = 1; + ++ dbus_error_init (&error); ++ + if ((udi = getenv ("UDI")) == NULL) + goto out; + if ((device_file = getenv ("HAL_PROP_BLOCK_DEVICE")) == NULL) +@@ -127,7 +129,6 @@ main (int argc, char *argv[]) + else + only_check_for_fs = FALSE; + +- dbus_error_init (&error); + if ((ctx = libhal_ctx_init_direct (&error)) == NULL) + goto out; + +diff --git a/hald/linux/probing/probe-video4linux.c b/hald/linux/probing/probe-video4linux.c +index cf913c0..7bc13e8 100644 +--- a/hald/linux/probing/probe-video4linux.c ++++ b/hald/linux/probing/probe-video4linux.c +@@ -58,6 +58,8 @@ main (int argc, char *argv[]) + + setup_logger (); + ++ dbus_error_init (&error); ++ + device_file = getenv ("HAL_PROP_VIDEO4LINUX_DEVICE"); + if (device_file == NULL) + goto out; +@@ -66,7 +68,6 @@ main (int argc, char *argv[]) + if (udi == NULL) + goto out; + +- dbus_error_init (&error); + ctx = libhal_ctx_init_direct (&error); + if (ctx == NULL) + goto out; +diff --git a/hald/linux/probing/probe-volume.c b/hald/linux/probing/probe-volume.c +index 0de1b91..7268fff 100644 +--- a/hald/linux/probing/probe-volume.c ++++ b/hald/linux/probing/probe-volume.c +@@ -318,6 +318,8 @@ main (int argc, char *argv[]) + /* assume failure */ + ret = 1; + ++ dbus_error_init (&error); ++ + if ((udi = getenv ("UDI")) == NULL) + goto out; + if ((device_file = getenv ("HAL_PROP_BLOCK_DEVICE")) == NULL) +@@ -346,7 +348,6 @@ main (int argc, char *argv[]) + + fsusage = getenv ("HAL_PROP_VOLUME_FSUSAGE"); + +- dbus_error_init (&error); + if ((ctx = libhal_ctx_init_direct (&error)) == NULL) + goto out; + diff --git a/source/l/hal/patches/fix_segfault_in_LIBHAL_FREE_DBUS_ERROR.diff b/source/l/hal/patches/fix_segfault_in_LIBHAL_FREE_DBUS_ERROR.diff new file mode 100644 index 00000000..b5bfdec6 --- /dev/null +++ b/source/l/hal/patches/fix_segfault_in_LIBHAL_FREE_DBUS_ERROR.diff @@ -0,0 +1,51 @@ +commit dcb2829b8eff61463b0869614ddb07b1c86cecaa +Author: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> +Date: Wed Dec 30 12:42:52 2009 +0100 + + linux/probe-input: don't use error prio init + + it may happen in the out: case that LIBHAL_FREE_DBUS_ERROR (&error) is + called before the error structure is initialized via + dbus_error_init (&error). This could lead to a segfault during startup + as seen in dmesg: + + |Intel AES-NI instructions are not detected. + |padlock: VIA PadLock not detected. + |hald-probe-inpu[1793]: segfault at 2 ip 00007f656fb68969 sp 00007fff39eeb950 error 4 in libc-2.10.2.so[7f656faf3000+14a000] + |hald-probe-inpu[1796]: segfault at 2 ip 00007fa2c3293969 sp 00007fffd92a5dd0 error 4 in libc-2.10.2.so[7fa2c321e000+14a000] + |hald-probe-inpu[1797]: segfault at 2 ip 00007f1d08ba2969 sp 00007fff34244e30 error 4 in libc-2.10.2.so[7f1d08b2d000+14a000] + |hald-probe-inpu[1799]: segfault at 2 ip 00007f35c0e3d969 sp 00007fffe5ec7ee0 error 4 in libc-2.10.2.so[7f35c0dc8000+14a000] + |hald-probe-inpu[1800]: segfault at 2 ip 00007f931c556969 sp 00007fffe1825b60 error 4 in libc-2.10.2.so[7f931c4e1000+14a000] + |hald-probe-inpu[1801]: segfault at 2 ip 00007f5156d9a969 sp 00007fff4e620af0 error 4 in libc-2.10.2.so[7f5156d25000+14a000] + |RPC: Registered udp transport module. + |RPC: Registered tcp transport module. + + What I run into seems to be reported as Debian #562068 [0]. This patch + makes the segfault go away on my machine. + + [0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562068 + + Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> + Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com> + + +diff --git a/hald/linux/probing/probe-input.c b/hald/linux/probing/probe-input.c +index 94e9929..cad47d3 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/source/l/hal/patches/fix_segfault_in_mdraid.diff b/source/l/hal/patches/fix_segfault_in_mdraid.diff deleted file mode 100644 index 88e5eaf6..00000000 --- a/source/l/hal/patches/fix_segfault_in_mdraid.diff +++ /dev/null @@ -1,36 +0,0 @@ -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 deleted file mode 100644 index 03549ec1..00000000 --- a/source/l/hal/patches/fixup_udi_strings.diff +++ /dev/null @@ -1,69 +0,0 @@ -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/handle_input.touchpad_explicitly.diff b/source/l/hal/patches/handle_input.touchpad_explicitly.diff new file mode 100644 index 00000000..b1231d6d --- /dev/null +++ b/source/l/hal/patches/handle_input.touchpad_explicitly.diff @@ -0,0 +1,75 @@ +commit 6dccf8e3ad181e8f56b1d2a994ec50a1953a1c2d +Author: Michael Witten <mfwitten@gmail.com> +Date: Tue Jan 5 18:53:17 2010 -0600 + + Policy: handle `input.touchpad' explicitly + + This commit essentially duplicates the policy for: + + <match key="info.capabilities" contains="input.mouse"> + + and then changes `input.mouse' to `input.touchpad'. This + is necessary because in Linus Torvalds's Linux repo: + + git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git + + the following commit: + + commit 7105d2ea73e1391b681d0e1212c42f561c64d429 + Author: Dmitry Torokhov <dmitry.torokhov@gmail.com> + Date: Fri Dec 11 23:54:54 2009 -0800 + + Input: ALPS - do not set REL_X/REL_Y capabilities on the touchpad + + Relative events are only reported via secondary device therefore device + associated with the touchpad should not advertise these capabilities. + + Signed-off-by: Dmitry Torokhov <dtor@mail.ru> + + so that HAL no longer adds: + + input.mouse + + to an ALPS touchpad's: + + info.capabilities + + so that HAL no longer marks the ALPS touchpad with: + + input.x11_driver = 'evdev' + + because the policy file: + + fdi/policy/10osvendor/10-x11-input.fdi + + doesn't define the policy for: + + <match key="info.capabilities" contains="input.touchpad"> + + which was previous unnecessary because everything used to + be caught by the policy for: + + <match key="info.capabilities" contains="input.mouse"> + + Signed-off-by: Michael Witten <mfwitten@gmail.com> + Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com> + +diff --git a/fdi/policy/10osvendor/10-x11-input.fdi b/fdi/policy/10osvendor/10-x11-input.fdi +index cff8fc5..8bbe263 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/source/l/hal/patches/hide_more_invalid_partitions.diff b/source/l/hal/patches/hide_more_invalid_partitions.diff deleted file mode 100644 index a4437d29..00000000 --- a/source/l/hal/patches/hide_more_invalid_partitions.diff +++ /dev/null @@ -1,66 +0,0 @@ -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 deleted file mode 100644 index 0056d8f9..00000000 --- a/source/l/hal/patches/ignore_dupe_add_events.diff +++ /dev/null @@ -1,40 +0,0 @@ -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/increase_HAL_PATH_MAX_to_4096.diff b/source/l/hal/patches/increase_HAL_PATH_MAX_to_4096.diff new file mode 100644 index 00000000..b4c770ae --- /dev/null +++ b/source/l/hal/patches/increase_HAL_PATH_MAX_to_4096.diff @@ -0,0 +1,30 @@ +commit a2c3dd5a04d79265772c09c4280606d5c2ed72c6 +Author: Martin Pitt <martin.pitt@ubuntu.com> +Date: Mon Jan 4 16:56:13 2010 +0100 + + Bump HAL_PATH_MAX to 4096 + + Some bits in the code use realpath() with destination paths of size + HAL_PATH_MAX. This potentially breaks on systems where PATH_MAX is bigger than + HAL_PATH_MAX (which was 512 until now). + + Since we can't use PATH_MAX directly (due to platforms like GNU/Hurd, which + apparently don't have it), just bump HAL_PATH_MAX to 4096 (as PATH_MAX is on + Linux), to avoid potential buffer overflows and also fix hal on Linux when + enabling FORTIFY in gcc. + + https://bugs.freedesktop.org/show_bug.cgi?id=25888 + +diff --git a/hald/util.h b/hald/util.h +index c2a1584..7883333 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); + 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 deleted file mode 100644 index ab398748..00000000 --- a/source/l/hal/patches/regen_fdi_cache_if_zero_size.diff +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index 933bcfa3..00000000 --- a/source/l/hal/patches/set_X_keymap_properly.diff +++ /dev/null @@ -1,96 +0,0 @@ -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 deleted file mode 100644 index 09f709e0..00000000 --- a/source/l/hal/patches/use_udevadm_not_udevinfo.patch +++ /dev/null @@ -1,36 +0,0 @@ -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/slack-desc b/source/l/hal/slack-desc index c01fd8a6..0145a5df 100644 --- a/source/l/hal/slack-desc +++ b/source/l/hal/slack-desc @@ -12,8 +12,8 @@ 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: the insertion of a DVD, or a USB flash memory stick). hal: hal: For more info, see: http://hal.freedesktop.org/ +hal: +hal: |