diff --git a/10-local.rules b/10-local.rules deleted file mode 100644 index f88cefe..0000000 --- a/10-local.rules +++ /dev/null @@ -1,2 +0,0 @@ -# Set bluetooth power up -ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", RUN+="/usr/bin/hciconfig %k up" diff --git a/bluetooth.conf b/bluetooth.conf deleted file mode 100644 index 3072d78..0000000 --- a/bluetooth.conf +++ /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/bluetooth.service b/bluetooth.service deleted file mode 100644 index baae230..0000000 --- a/bluetooth.service +++ /dev/null @@ -1,21 +0,0 @@ -[Unit] -Description=Bluetooth service -Documentation=man:bluetoothd(8) -ConditionPathIsDirectory=/sys/class/bluetooth -After=NetworkManager.service - -[Service] -Type=dbus -BusName=org.bluez -ExecStart=/usr/bin/bluetoothd -NotifyAccess=main -#WatchdogSec=10 -#Restart=on-failure -CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE -LimitNPROC=1 -ProtectHome=true -ProtectSystem=full - -[Install] -WantedBy=bluetooth.target -Alias=dbus-org.bluez.service diff --git a/bluez-5.36-systemd-conditional.patch b/bluez-5.36-systemd-conditional.patch new file mode 100644 index 0000000..67b4910 --- /dev/null +++ b/bluez-5.36-systemd-conditional.patch @@ -0,0 +1,38 @@ +From 488fd81a0f9cb193a733ac03fba0a80c145868c9 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 20 Oct 2015 12:24:45 +0200 +Subject: systemd: Check if bluetooth is supported in the kernel + +When running a kernel without bluetooth support, bluetooth.service fails to +start with + + bluetoothd[1640]: Failed to access management interface + bluetoothd[1640]: Adapter handling initialization failed + systemd[1]: bluetooth.service: Main process exited, code=exited, status=1/FAILURE + systemd[1]: Failed to start Bluetooth service. + +This causes an unnecessary "degraded" state and more importantly breaks package +installation when the bluez package auto-starts the daemon. + +Add a condition to only start the service if /sys/class/bluetooth exists. + +https://launchpad.net/bugs/1506774 +--- + src/bluetooth.service.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/bluetooth.service.in b/src/bluetooth.service.in +index 35e9457..83e4732 100644 +--- a/src/bluetooth.service.in ++++ b/src/bluetooth.service.in +@@ -1,6 +1,7 @@ + [Unit] + Description=Bluetooth service + Documentation=man:bluetoothd(8) ++ConditionPathIsDirectory=/sys/class/bluetooth + + [Service] + Type=dbus +-- +cgit v0.11.2 + diff --git a/bluez-5.50-allow-using-obexd-without-systemd-in-the-user-sessio.patch b/bluez-5.50-allow-using-obexd-without-systemd-in-the-user-sessio.patch index 1ea3e6f..e52d12c 100644 --- a/bluez-5.50-allow-using-obexd-without-systemd-in-the-user-sessio.patch +++ b/bluez-5.50-allow-using-obexd-without-systemd-in-the-user-sessio.patch @@ -1,24 +1,7 @@ -From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001 -From: Giovanni Campagna -Date: Sat, 12 Oct 2013 17:45:25 +0200 -Subject: [PATCH] Allow using obexd without systemd in the user session - -Not all sessions run systemd --user (actually, the majority -doesn't), so the dbus daemon must be able to spawn obexd -directly, and to do so it needs the full path of the daemon. ---- - Makefile.obexd | 4 ++-- - obexd/src/org.bluez.obex.service | 4 ---- - obexd/src/org.bluez.obex.service.in | 4 ++++ - 3 files changed, 6 insertions(+), 6 deletions(-) - delete mode 100644 obexd/src/org.bluez.obex.service - create mode 100644 obexd/src/org.bluez.obex.service.in - -diff --git a/Makefile.obexd b/Makefile.obexd -index 3760867..142e7c3 100644 ---- a/Makefile.obexd -+++ b/Makefile.obexd -@@ -2,12 +2,12 @@ +diff -urN bluez-5.50/Makefile.obexd bluez-5.50-patched/Makefile.obexd +--- bluez-5.50/Makefile.obexd 2018-06-01 11:37:35.000000000 +0300 ++++ bluez-5.50-patched/Makefile.obexd 2018-06-05 09:28:26.537699230 +0300 +@@ -1,12 +1,12 @@ if SYSTEMD systemduserunitdir = @SYSTEMD_USERUNITDIR@ systemduserunit_DATA = obexd/src/obex.service @@ -31,28 +14,21 @@ index 3760867..142e7c3 100644 -EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service +EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in - obex_plugindir = $(libdir)/obex/plugins + if OBEX -diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service -deleted file mode 100644 -index a538088..0000000 ---- a/obexd/src/org.bluez.obex.service -+++ /dev/null +diff -urN bluez-5.50/obexd/src/org.bluez.obex.service bluez-5.50-patched/obexd/src/org.bluez.obex.service +--- bluez-5.50/obexd/src/org.bluez.obex.service 2012-12-24 21:46:55.000000000 +0400 ++++ bluez-5.50-patched/obexd/src/org.bluez.obex.service 1970-01-01 03:00:00.000000000 +0300 @@ -1,4 +0,0 @@ -[D-BUS Service] -Name=org.bluez.obex -Exec=/bin/false -SystemdService=dbus-org.bluez.obex.service -diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in -new file mode 100644 -index 0000000..9c815f2 ---- /dev/null -+++ b/obexd/src/org.bluez.obex.service.in +diff -urN bluez-5.50/obexd/src/org.bluez.obex.service.in bluez-5.50-patched/obexd/src/org.bluez.obex.service.in +--- bluez-5.50/obexd/src/org.bluez.obex.service.in 1970-01-01 03:00:00.000000000 +0300 ++++ bluez-5.50-patched/obexd/src/org.bluez.obex.service.in 2018-06-05 09:30:29.454367592 +0300 @@ -0,0 +1,4 @@ +[D-BUS Service] +Name=org.bluez.obex +Exec=@libexecdir@/obexd +SystemdService=dbus-org.bluez.obex.service --- -1.8.3.1 - diff --git a/bluez.spec b/bluez.spec index 485860f..d97add9 100644 --- a/bluez.spec +++ b/bluez.spec @@ -4,9 +4,8 @@ Summary: Official Linux Bluetooth protocol stack Name: bluez -Version: 5.49 +Version: 5.50 Release: 4 -Epoch: 2 License: GPLv2+ Group: Communications Url: http://www.bluez.org/ @@ -15,17 +14,16 @@ Source1: pand.conf Source2: dund.conf Source3: hidd.conf Source4: rfcomm.conf -Source5: bluetooth.conf -Source6: 10-local.rules -Source7: 97-bluetooth.rules -Source8: bluetooth.service +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 -Patch0: 0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch +Patch1: 0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch # Non-upstream -Patch1: bluez-5.50-allow-using-obexd-without-systemd-in-the-user-sessio.patch -Patch2: 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch -Patch3: 0004-agent-Assert-possible-infinite-loop.patch +Patch2: bluez-5.50-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 @@ -89,9 +87,7 @@ These are the official Bluetooth communication libraries for Linux. %dir %{_libdir}/bluetooth %dir %{_libdir}/bluetooth/plugins %{_libdir}/bluetooth/plugins/sixaxis.so -%{_sysconfdir}/udev/rules.d/97-bluetooth.rules -%{_sysconfdir}/udev/rules.d/10-local.rules -%{_sysconfdir}/modprobe.d/bluetooth.conf +%{_udevrulesdir}/97-bluetooth.rules %post %_post_service bluetooth @@ -199,10 +195,11 @@ BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A. %prep %setup -q -%patch0 -p1 +%patch0 -p1 -R %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 libtoolize -f -c autoreconf -fi @@ -226,6 +223,7 @@ autoreconf -fi --enable-datafiles \ --enable-experimental \ --enable-nfc \ + --enable-sap \ --enable-health %make @@ -253,19 +251,13 @@ install -d %{buildroot}%{_prefix}/lib mv %{buildroot}%{_libdir}/cups %{buildroot}%{_prefix}/lib/cups %endif -mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d -install -m644 %{SOURCE5} -D %{buildroot}%{_sysconfdir}/modprobe.d/bluetooth.conf - cp test/test-* %{buildroot}%{_bindir} 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 %{SOURCE6} -D %{buildroot}%{_sysconfdir}/udev/rules.d/10-local.rules -install -m644 %{SOURCE7} -D %{buildroot}%{_sysconfdir}/udev/rules.d/97-bluetooth.rules -install -m644 %{SOURCE8} -D %{buildroot}%{_unitdir}/bluetooth.service -sed s,"/usr/bin/bluetoothd","%{_libexecdir}/bluetooth/bluetoothd",g -i %{buildroot}%{_sysconfdir}/udev/rules.d/97-bluetooth.rules -sed s,"/usr/bin/bluetoothd","%{_libexecdir}/bluetooth/bluetoothd",g -i %{buildroot}%{_unitdir}/bluetooth.service +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/