From d3a3a8bf3b1b2e821f746acb72e84ff1edce1403 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 20 Sep 2017 14:54:22 +0200 Subject: [PATCH] + bluez-5.47-3 Fix adapter name not picking up PrettyHostname --- ...x-BlueZ-5.XX-adapter-name-on-startup.patch | 38 +++++++++++++++++++ bluez.spec | 9 ++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 0001-hostname-Fix-BlueZ-5.XX-adapter-name-on-startup.patch diff --git a/0001-hostname-Fix-BlueZ-5.XX-adapter-name-on-startup.patch b/0001-hostname-Fix-BlueZ-5.XX-adapter-name-on-startup.patch new file mode 100644 index 0000000..4caffdb --- /dev/null +++ b/0001-hostname-Fix-BlueZ-5.XX-adapter-name-on-startup.patch @@ -0,0 +1,38 @@ +From cba55944f76ad0f01bb7c8976fd6699f058c68cd Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Wed, 20 Sep 2017 14:42:14 +0200 +Subject: [PATCH] hostname: Fix "BlueZ 5.XX" adapter name on startup + +The hostname plugin listens to property changes from systemd-hostnamed +but doesn't fetch initial values. This means that unless the +PrettyHostname or StaticHostname changes, the default adapter will be +called "BlueZ 5.XX" matching the version number. + +This is the case since the hostname plugin replaced the adaptername +plugin in 2012. + +Fetch the initial values for PrettyHostname, StaticHostname and +Chassis when the plugin is initiated, so as to make the values +available for adapter setup. +--- + plugins/hostname.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/plugins/hostname.c b/plugins/hostname.c +index f876d0afb..db9187378 100644 +--- a/plugins/hostname.c ++++ b/plugins/hostname.c +@@ -307,6 +307,10 @@ static int hostname_init(void) + hostname_proxy = NULL; + g_dbus_client_unref(hostname_client); + hostname_client = NULL; ++ } else { ++ g_dbus_proxy_refresh_property(hostname_proxy, "PrettyHostname"); ++ g_dbus_proxy_refresh_property(hostname_proxy, "StaticHostname"); ++ g_dbus_proxy_refresh_property(hostname_proxy, "Chassis"); + } + + return err; +-- +2.14.1 + diff --git a/bluez.spec b/bluez.spec index f002809..a7d926b 100644 --- a/bluez.spec +++ b/bluez.spec @@ -1,7 +1,7 @@ Name: bluez Summary: Bluetooth utilities Version: 5.47 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ URL: http://www.bluez.org/ @@ -26,6 +26,9 @@ Patch4: 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch # https://github.com/hadess/bluez/commits/autopair-5.46 Patch5: 0001-autopair-Don-t-handle-the-iCade.patch +# https://github.com/hadess/bluez/commits/hostname-plugin-5.47 +Patch6: 0001-hostname-Fix-BlueZ-5.XX-adapter-name-on-startup.patch + # https://github.com/hadess/bluez/commits/ds4-cable-pairing Patch101: 0001-plugins-sixaxis-Remove-LEDs-handling.patch Patch102: 0002-adapter-Add-btd_request_authorization_cable_configur.patch @@ -272,6 +275,10 @@ install -D -p -m0755 %{SOURCE4} ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/ %{_userunitdir}/obex.service %changelog +* Wed Sep 20 2017 Bastien Nocera - 5.47-3 ++ bluez-5.47-3 +- Fix adapter name not picking up PrettyHostname + * Wed Sep 20 2017 Bastien Nocera - 5.47-2 + bluez-5.47-2 - Lockdown Bluetooth systemd service