diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2016-06-30 20:26:57 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 23:31:18 +0200 |
commit | d31c50870d0bee042ce660e445c9294a59a3a65b (patch) | |
tree | 6bfc0de3c95267b401b620c2c67859557dc60f97 /source/n/bluez/config | |
parent | 76fc4757ac91ac7947a01fb7b53dddf9a78a01d1 (diff) | |
download | current-d31c50870d0bee042ce660e445c9294a59a3a65b.tar.gz current-d31c50870d0bee042ce660e445c9294a59a3a65b.tar.xz |
Slackware 14.2slackware-14.2
Thu Jun 30 20:26:57 UTC 2016
Slackware 14.2 x86_64 stable is released!
The long development cycle (the Linux community has lately been living in
"interesting times", as they say) is finally behind us, and we're proud to
announce the release of Slackware 14.2. The new release brings many updates
and modern tools, has switched from udev to eudev (no systemd), and adds
well over a hundred new packages to the system. Thanks to the team, the
upstream developers, the dedicated Slackware community, and everyone else
who pitched in to help make this release a reality.
The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided
32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware
project by picking up a copy from store.slackware.com. We're taking
pre-orders now, and offer a discount if you sign up for a subscription.
Have fun! :-)
Diffstat (limited to 'source/n/bluez/config')
-rw-r--r-- | source/n/bluez/config/bluetooth.modprobe | 3 | ||||
-rw-r--r-- | source/n/bluez/config/bluetooth.sh | 7 | ||||
-rw-r--r-- | source/n/bluez/config/defaultconfig | 9 | ||||
-rw-r--r-- | source/n/bluez/config/rc.bluetooth | 67 | ||||
-rw-r--r-- | source/n/bluez/config/uart.conf | 6 |
5 files changed, 71 insertions, 21 deletions
diff --git a/source/n/bluez/config/bluetooth.modprobe b/source/n/bluez/config/bluetooth.modprobe deleted file mode 100644 index 3072d7885..000000000 --- a/source/n/bluez/config/bluetooth.modprobe +++ /dev/null @@ -1,3 +0,0 @@ -# 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/source/n/bluez/config/bluetooth.sh b/source/n/bluez/config/bluetooth.sh deleted file mode 100644 index 22034551c..000000000 --- a/source/n/bluez/config/bluetooth.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/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/source/n/bluez/config/defaultconfig b/source/n/bluez/config/defaultconfig new file mode 100644 index 000000000..b4da786e1 --- /dev/null +++ b/source/n/bluez/config/defaultconfig @@ -0,0 +1,9 @@ +# /etc/default/bluetooth + +# A space delimied list of devices to start at boot time +ACTIVE_HCI_DEVICES_ON_BOOT="hci0" + +# A semicolon delimited list of SDP (Service Discovery Protocol) +# operations for bluetooth devices. See the sdptool for more details. +SDPTOOL_OPTIONS="" + diff --git a/source/n/bluez/config/rc.bluetooth b/source/n/bluez/config/rc.bluetooth index 296c45422..b56fcd101 100644 --- a/source/n/bluez/config/rc.bluetooth +++ b/source/n/bluez/config/rc.bluetooth @@ -1,28 +1,73 @@ #!/bin/sh -bluez_start() { - /usr/sbin/bluetoothd +# /etc/rc.d/rc.bluetooth (based on BLFS script) + +# Populated from /etc/default/bluetooth: +# ACTIVE_HCI_DEVICES_ON_BOOT and SDPTOOL_OPTIONS + +[ -r /etc/default/bluetooth ] && . /etc/default/bluetooth + +start_hci_dev() { + for dev in ${ACTIVE_HCI_DEVICES_ON_BOOT} ; do + hciconfig $dev up > /dev/null 2>&1 + done +} + +run_sdptool() { + # Declaring IFS local in this function, removes the need to save/restore it + local IFS option + test -x /usr/bin/sdptool || return 1 + IFS=";" + for option in ${SDPTOOL_OPTIONS}; do + IFS=" " + /usr/bin/sdptool $option > /dev/null 2>&1 + done +} + +start_uarts() { + [ -r /etc/bluetooth/uart.conf ] || return + grep -v '^[[:space:]]*(#|$)' /etc/bluetooth/uart.conf | while read i; do + /usr/bin/hciattach $i > /dev/null 2>&1 + done +} + +stop_uarts() { + killall /usr/bin/hciattach > /dev/null 2>&1 +} + +start() { + if [ -d /sys/class/bluetooth ]; then + # Start as background process and assume OK + echo -n "Starting Bluetooth services: bluetoothd " + /usr/sbin/bluetoothd & + echo -n "hciconfig " + start_hci_dev + echo -n "sdptool " + run_sdptool + echo "hciattach" + start_uarts + fi } -bluez_stop() { - udevadm trigger --subsystem-match=bluetooth --action=remove - pkill -TERM bluetoothd 1>/dev/null 2>/dev/null +stop() { + stop_uarts + killall /usr/sbin/bluetoothd > /dev/null 2>&1 } -case "$1" in +case "${1}" in start) - bluez_start + start ;; stop) - bluez_stop + stop ;; restart) - bluez_stop + stop sleep 1 - bluez_start + start ;; *) - printf "Usage: $N {start|stop|restart}\n" + echo "Usage: ${0} {start|stop|restart}" exit 1 ;; esac diff --git a/source/n/bluez/config/uart.conf b/source/n/bluez/config/uart.conf new file mode 100644 index 000000000..b2e276f4e --- /dev/null +++ b/source/n/bluez/config/uart.conf @@ -0,0 +1,6 @@ +# /etc/bluetooth/uart.conf + +# Attach serial devices via UART HCI to BlueZ stack +# Use one line per device +# See the hciattach man page for options + |