diff --git a/0002-autopair-Don-t-handle-the-iCade.patch b/0002-autopair-Don-t-handle-the-iCade.patch deleted file mode 100644 index 68751ae..0000000 --- a/0002-autopair-Don-t-handle-the-iCade.patch +++ /dev/null @@ -1,47 +0,0 @@ -From c16ae7041c7511d8d1ed8441f696716fa6a9117e Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Tue, 19 Nov 2013 14:11:39 +0100 -Subject: [PATCH 2/5] autopair: Don't handle the iCade - -We can't easily enter digits other than 1 through 4 (inclusive) -so leave it up to the agent to figure out a good passcode -for the iCade. - -Note that we can not use the VID/PID of the device, as it is not -yet known at that point. ---- - plugins/autopair.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/plugins/autopair.c b/plugins/autopair.c -index 8c98c12..5d2f6f7 100644 ---- a/plugins/autopair.c -+++ b/plugins/autopair.c -@@ -57,13 +57,23 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter, - { - char addr[18]; - char pinstr[7]; -+ char name[25]; - uint32_t class; - - ba2str(device_get_address(device), addr); - - class = btd_device_get_class(device); - -- DBG("device %s 0x%x", addr, class); -+ device_get_name(device, name, sizeof(name)); -+ name[sizeof(name) - 1] = 0; -+ -+ DBG("device %s (%s) 0x%x", addr, name, class); -+ -+ g_message ("vendor 0x%X product: 0x%X", btd_device_get_vendor (device), btd_device_get_product (device)); -+ -+ /* The iCade shouldn't use random PINs like normal keyboards */ -+ if (name != NULL && strstr(name, "iCade") != NULL) -+ return 0; - - /* This is a class-based pincode guesser. Ignore devices with an - * unknown class. --- -1.8.4.2 - diff --git a/97-bluetooth.rules b/97-bluetooth.rules new file mode 100644 index 0000000..6fc3a0f --- /dev/null +++ b/97-bluetooth.rules @@ -0,0 +1,4 @@ +# Run helper every time a Bluetooth device appears +# On remove actions, bluetoothd should go away by itself +ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/bin/bluetoothd" +ACTION=="change", SUBSYSTEM=="bluetooth", RUN+="/usr/bin/bluetoothd" diff --git a/bluez.spec b/bluez.spec index 9f13f3d..2ebd14b 100644 --- a/bluez.spec +++ b/bluez.spec @@ -5,7 +5,7 @@ Summary: Official Linux Bluetooth protocol stack Name: bluez Version: 5.49 -Release: 2 +Release: 3 License: GPLv2+ Group: Communications Url: http://www.bluez.org/ @@ -14,17 +14,16 @@ Source1: pand.conf Source2: dund.conf Source3: hidd.conf Source4: rfcomm.conf +Source5: 97-bluetooth.rules Source10: bluez-uinput.modules # Revert this commit, it leads to huge delay on boot in Plasma 5 Patch0: bluez-5.36-systemd-conditional.patch - ## Ubuntu patches -Patch2: 0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch +Patch1: 0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch # Non-upstream -Patch3: 0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch - -Patch4: 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch -Patch6: 0004-agent-Assert-possible-infinite-loop.patch +Patch2: 0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch +Patch3: 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch +Patch4: 0004-agent-Assert-possible-infinite-loop.patch BuildRequires: bison BuildRequires: flex BuildRequires: cups-devel @@ -88,6 +87,7 @@ These are the official Bluetooth communication libraries for Linux. %dir %{_libdir}/bluetooth %dir %{_libdir}/bluetooth/plugins %{_libdir}/bluetooth/plugins/sixaxis.so +%{_udevrulesdir}/97-bluetooth.rules %post %_post_service bluetooth @@ -196,12 +196,10 @@ BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A. %prep %setup -q %patch0 -p1 -R - +%patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 -%patch6 -p1 libtoolize -f -c autoreconf -fi @@ -258,6 +256,8 @@ cp test/simple-agent %{buildroot}%{_bindir}/simple-agent rm %{buildroot}%{_sysconfdir}/udev/rules.d/*.rules install -p -m644 tools/hid2hci.rules -D %{buildroot}/lib/udev/rules.d/97-hid2hci.rules +install -m644 %{SOURCE5} -D %{buildroot}%{_udevrulesdir}/97-bluetooth.rules +sed s,"/usr/bin/bluetoothd","%{_libexecdir}/bluetooth/bluetoothd",g -i %{buildroot}%{_udevrulesdir}/97-bluetooth.rules #install more config files install -m0644 profiles/network/network.conf %{buildroot}%{_sysconfdir}/bluetooth/