From a1c66857a471cf6aa8c9def823bbe477485e6b3e Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 15 Dec 2021 11:08:27 +0100 Subject: contrib: Add script to unbind an adapter from its driver This makes the Bluetooth drivers not handle the device, while still making sure the USB part of it is available for other purposes, such as virtualisation and gaming. --- contrib/unbind-bluetooth-driver.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 contrib/unbind-bluetooth-driver.sh (limited to 'contrib') diff --git a/contrib/unbind-bluetooth-driver.sh b/contrib/unbind-bluetooth-driver.sh new file mode 100755 index 00000000..fcf02858 --- /dev/null +++ b/contrib/unbind-bluetooth-driver.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +ADAPTER_TO_DISABLE=${1:-hci0} +SYSFS_PATH=/sys/class/bluetooth/$ADAPTER_TO_DISABLE + +if [ ! -h $SYSFS_PATH ] ; then + echo "Could not find adapter $ADAPTER_TO_DISABLE" + echo "Usage: $0 [hciX]" + exit 1 +fi + +USB_DEVICE_PATH=`realpath $SYSFS_PATH/device` +USB_DEVICE=`basename $USB_DEVICE_PATH` +echo $USB_DEVICE > $SYSFS_PATH/device/driver/unbind -- cgit v1.2.1