[gnome-bluetooth/wip/hadess/default-adapter-work: 1/5] contrib: Add script to unbind an adapter from its driver
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/default-adapter-work: 1/5] contrib: Add script to unbind an adapter from its driver
- Date: Wed, 15 Dec 2021 10:17:02 +0000 (UTC)
commit b5486ea533a9b8e4f6c4840790bd7e69e9f48a0b
Author: Bastien Nocera <hadess hadess net>
Date: Wed Dec 15 11:08:27 2021 +0100
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(+)
---
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]