summaryrefslogtreecommitdiffstats
path: root/patches/source/bluez/config
diff options
context:
space:
mode:
Diffstat (limited to 'patches/source/bluez/config')
-rw-r--r--patches/source/bluez/config/bluetooth.modprobe3
-rw-r--r--patches/source/bluez/config/bluetooth.sh7
-rw-r--r--patches/source/bluez/config/rc.bluetooth29
3 files changed, 39 insertions, 0 deletions
diff --git a/patches/source/bluez/config/bluetooth.modprobe b/patches/source/bluez/config/bluetooth.modprobe
new file mode 100644
index 00000000..3072d788
--- /dev/null
+++ b/patches/source/bluez/config/bluetooth.modprobe
@@ -0,0 +1,3 @@
+# use "reset=1" as default, since it should be safe for recent devices and
+# solves all kind of problems.
+options btusb reset=1
diff --git a/patches/source/bluez/config/bluetooth.sh b/patches/source/bluez/config/bluetooth.sh
new file mode 100644
index 00000000..22034551
--- /dev/null
+++ b/patches/source/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
+
diff --git a/patches/source/bluez/config/rc.bluetooth b/patches/source/bluez/config/rc.bluetooth
new file mode 100644
index 00000000..296c4542
--- /dev/null
+++ b/patches/source/bluez/config/rc.bluetooth
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+bluez_start() {
+ /usr/sbin/bluetoothd
+}
+
+bluez_stop() {
+ udevadm trigger --subsystem-match=bluetooth --action=remove
+ pkill -TERM bluetoothd 1>/dev/null 2>/dev/null
+}
+
+case "$1" in
+ start)
+ bluez_start
+ ;;
+ stop)
+ bluez_stop
+ ;;
+ restart)
+ bluez_stop
+ sleep 1
+ bluez_start
+ ;;
+ *)
+ printf "Usage: $N {start|stop|restart}\n"
+ exit 1
+ ;;
+esac
+