diff options
Diffstat (limited to 'source/n/bluez')
-rw-r--r-- | source/n/bluez/bluez-run_udev_helper.patch | 14 | ||||
-rwxr-xr-x | source/n/bluez/bluez.SlackBuild | 11 | ||||
-rw-r--r-- | source/n/bluez/config/bluetooth.sh | 7 |
3 files changed, 30 insertions, 2 deletions
diff --git a/source/n/bluez/bluez-run_udev_helper.patch b/source/n/bluez/bluez-run_udev_helper.patch new file mode 100644 index 00000000..a3a71e6d --- /dev/null +++ b/source/n/bluez/bluez-run_udev_helper.patch @@ -0,0 +1,14 @@ +Instead of automatically starting the bluetooth subsystem when devices +are added, let's invoke a wrapper script in /lib/udev and have that +wrapper check whether /etc/rc.d/rc.bluetooth is executable first. + +diff -Nur bluez-4.99/scripts/bluetooth.rules.in bluez-4.99.orig/scripts/bluetooth.rules.in +--- bluez-4.99.orig/scripts/bluetooth.rules.in 2010-10-02 18:25:27.000000000 -0500 ++++ bluez-4.99/scripts/bluetooth.rules.in 2013-06-27 22:05:55.572332197 -0500 +@@ -1,4 +1,4 @@ + # Run helper every time a Bluetooth device appears + # On remove actions, bluetoothd should go away by itself +-ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="@prefix@/sbin/bluetoothd --udev" +-ACTION=="change", SUBSYSTEM=="bluetooth", RUN+="@prefix@/sbin/bluetoothd --udev" ++ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/lib/udev/bluetooth.sh" ++ACTION=="change", SUBSYSTEM=="bluetooth", RUN+="/lib/udev/bluetooth.sh" diff --git a/source/n/bluez/bluez.SlackBuild b/source/n/bluez/bluez.SlackBuild index d77c1514..b1f31593 100755 --- a/source/n/bluez/bluez.SlackBuild +++ b/source/n/bluez/bluez.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for bluez - http://www.bluez.org -# Copyright 2009, 2010, 2011, 2012 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2009, 2010, 2011, 2012, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,7 +24,7 @@ PKGNAM=bluez VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} NUMJOBS=${NUMJOBS:-" -j7 "} @@ -70,6 +70,9 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# Start bluetoothd via a wrapper script to check rc.bluetooth's +/-x first +zcat $CWD/bluez-run_udev_helper.patch.gz | patch -p1 --verbose || exit 1 + # Enable the audio socket in audio.conf: zcat $CWD/bluez.enable.audio.socket.diff.gz | patch -p1 --verbose || exit 1 @@ -142,6 +145,10 @@ mv $PKG/usr/share/alsa/bluetooth.conf $PKG/etc/alsa done ) +# Add the wrapper script +cat $CWD/config/bluetooth.sh > $PKG/lib/udev/bluetooth.sh +chmod 0755 $PKG/lib/udev/bluetooth.sh + # Add an init script mkdir -p $PKG/etc/rc.d cat $CWD/config/rc.bluetooth > $PKG/etc/rc.d/rc.bluetooth.new diff --git a/source/n/bluez/config/bluetooth.sh b/source/n/bluez/config/bluetooth.sh new file mode 100644 index 00000000..22034551 --- /dev/null +++ b/source/n/bluez/config/bluetooth.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# Check whether /etc/rc.d/rc.bluetooth is executable before starting +# the bluetooth subsystem for hotplugged bluetooth devices +[ -x /etc/rc.d/rc.bluetooth ] && exec /usr/sbin/bluetoothd --udev +exit 0 + |