From dde94d75d1c91b564da7bedd6dac296b19ee225e Mon Sep 17 00:00:00 2001 From: Bruno Randolf Date: Fri, 29 May 2015 14:58:29 +0100 Subject: [PATCH 1/8] bluez: Add bluez-daemon package Move bluetoothd and related programs and files from bluez-utils into bluez-daemon package. The main motivation for this is to remove the dependency to DBus from bluez-utils. The utilities like "hcitool" are useful without it. Also add kmod-bluetooth dependency to bluez-utils, as the utils don't make much sense without bluetooth support in the kernel. Signed-off-by: Bruno Randolf --- utils/bluez/Makefile | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile index 4865698f2a..ebc1646396 100644 --- a/utils/bluez/Makefile +++ b/utils/bluez/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bluez PKG_VERSION:=5.30 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/bluetooth/ @@ -47,7 +47,7 @@ $(call Package/bluez/Default) SECTION:=libs CATEGORY:=Libraries TITLE+= library - DEPENDS:=+libpthread + DEPENDS:=+libpthread +kmod-bluetooth endef define Package/bluez-utils @@ -55,10 +55,18 @@ $(call Package/bluez/Default) SECTION:=utils CATEGORY:=Utilities TITLE+= utilities - DEPENDS:=+bluez-libs +libpthread +librt +dbus +glib2 +libical +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS) + DEPENDS:=+bluez-libs +libpthread +librt +glib2 +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS) endef -define Package/bluez-utils/conffiles +define Package/bluez-daemon +$(call Package/bluez/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= daemon + DEPENDS:=+bluez-libs +bluez-utils +dbus +libical $(INTL_DEPENDS) $(ICONV_DEPENDS) +endef + +define Package/bluez-daemon/conffiles /etc/bluetooth/main.conf /etc/bluetooth/network.conf /etc/bluetooth/input.conf @@ -109,10 +117,28 @@ endef define Package/bluez-utils/install $(INSTALL_DIR) $(1)/usr/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcidump $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hcitool $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/hex2hcd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2ping $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/l2test $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/rctest $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/rfcomm $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/sdptool $(1)/usr/bin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/attrib/gatttool $(1)/usr/bin/ +endef + +define Package/bluez-daemon/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluetoothctl $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/ $(INSTALL_DIR) $(1)/etc/config $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/ @@ -129,3 +155,4 @@ endef $(eval $(call BuildPackage,bluez-examples)) $(eval $(call BuildPackage,bluez-libs)) $(eval $(call BuildPackage,bluez-utils)) +$(eval $(call BuildPackage,bluez-daemon)) From c2fb968f029ee7bc5e41b718ba5eadcbc69bba04 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 11 Jul 2015 22:58:08 +0200 Subject: [PATCH 2/8] bluez: add btmgmt tool The btmgmt tool is needed to activate BL LE support. Currently it is not installed. Signed-off-by: Hauke Mehrtens --- utils/bluez/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile index ebc1646396..0bf58b7655 100644 --- a/utils/bluez/Makefile +++ b/utils/bluez/Makefile @@ -120,6 +120,7 @@ define Package/bluez-utils/install $(CP) $(PKG_INSTALL_DIR)/usr/bin/bccmd $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/bin/bluemoon $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/bin/btmon $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/tools/btmgmt $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/bin/ciptool $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciattach $(1)/usr/bin/ $(CP) $(PKG_INSTALL_DIR)/usr/bin/hciconfig $(1)/usr/bin/ From f4665c4ae4843a2c5bb33d495c5e0202cab9c245 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 5 Jul 2015 00:27:56 +0200 Subject: [PATCH 3/8] bluez: update to version 5.31 Signed-off-by: Hauke Mehrtens --- utils/bluez/Makefile | 8 ++++---- utils/bluez/patches/201-readline.patch | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile index 0bf58b7655..ce14975827 100644 --- a/utils/bluez/Makefile +++ b/utils/bluez/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bluez -PKG_VERSION:=5.30 -PKG_RELEASE:=2 +PKG_VERSION:=5.31 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/bluetooth/ -PKG_MD5SUM:=24ba1d1e8e7ef5b8f4033a3059d7600e +PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/ +PKG_MD5SUM:=cb1db487b65dd4d57a2dd6b8f063c393 PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING diff --git a/utils/bluez/patches/201-readline.patch b/utils/bluez/patches/201-readline.patch index 58396dcb01..dba14b4561 100644 --- a/utils/bluez/patches/201-readline.patch +++ b/utils/bluez/patches/201-readline.patch @@ -1,6 +1,6 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -2055,7 +2055,7 @@ unit_tests = $(am__append_32) unit/test- +@@ -2394,7 +2394,7 @@ unit_tests = $(am__append_32) unit/test- @CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ @@ -9,7 +9,7 @@ @MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ @MONITOR_TRUE@ monitor/display.h monitor/display.c \ -@@ -2226,7 +2226,7 @@ unit_tests = $(am__append_32) unit/test- +@@ -2594,7 +2594,7 @@ unit_tests = $(am__append_32) unit/test- @EXPERIMENTAL_TRUE@tools_hcieventmask_LDADD = lib/libbluetooth-internal.la @EXPERIMENTAL_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c @EXPERIMENTAL_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \ @@ -18,7 +18,7 @@ @EXPERIMENTAL_TRUE@tools_btinfo_SOURCES = tools/btinfo.c monitor/bt.h @EXPERIMENTAL_TRUE@tools_btinfo_LDADD = src/libshared-mainloop.la -@@ -2266,13 +2266,13 @@ unit_tests = $(am__append_32) unit/test- +@@ -2642,13 +2642,13 @@ unit_tests = $(am__append_32) unit/test- @READLINE_TRUE@ client/display.h @READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ @@ -34,7 +34,7 @@ @READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ @READLINE_TRUE@ tools/obex-server-tool.c -@@ -2282,13 +2282,13 @@ unit_tests = $(am__append_32) unit/test- +@@ -2658,13 +2658,13 @@ unit_tests = $(am__append_32) unit/test- @READLINE_TRUE@ client/display.h client/display.c @READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ From b4a4c1e4bf1bbc1516d6c32e6153d74ca0ec1763 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 3 Aug 2015 22:35:56 +0200 Subject: [PATCH 4/8] bluez: update to version 5.33 Signed-off-by: Hauke Mehrtens --- utils/bluez/Makefile | 4 ++-- utils/bluez/patches/201-readline.patch | 20 ++++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile index ce14975827..e7b504832f 100644 --- a/utils/bluez/Makefile +++ b/utils/bluez/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bluez -PKG_VERSION:=5.31 +PKG_VERSION:=5.33 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/ -PKG_MD5SUM:=cb1db487b65dd4d57a2dd6b8f063c393 +PKG_MD5SUM:=78782dc33d9a8b6344c4cc1af70c8a98 PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING diff --git a/utils/bluez/patches/201-readline.patch b/utils/bluez/patches/201-readline.patch index dba14b4561..3d6ffaec33 100644 --- a/utils/bluez/patches/201-readline.patch +++ b/utils/bluez/patches/201-readline.patch @@ -1,6 +1,6 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -2394,7 +2394,7 @@ unit_tests = $(am__append_32) unit/test- +@@ -2405,7 +2405,7 @@ unit_tests = $(am__append_32) unit/test- @CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ @@ -9,16 +9,7 @@ @MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ @MONITOR_TRUE@ monitor/display.h monitor/display.c \ -@@ -2594,7 +2594,7 @@ unit_tests = $(am__append_32) unit/test- - @EXPERIMENTAL_TRUE@tools_hcieventmask_LDADD = lib/libbluetooth-internal.la - @EXPERIMENTAL_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c - @EXPERIMENTAL_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \ --@EXPERIMENTAL_TRUE@ -lreadline -+@EXPERIMENTAL_TRUE@ -lreadline -lncurses - - @EXPERIMENTAL_TRUE@tools_btinfo_SOURCES = tools/btinfo.c monitor/bt.h - @EXPERIMENTAL_TRUE@tools_btinfo_LDADD = src/libshared-mainloop.la -@@ -2642,13 +2642,13 @@ unit_tests = $(am__append_32) unit/test- +@@ -2651,13 +2651,13 @@ unit_tests = $(am__append_32) unit/test- @READLINE_TRUE@ client/display.h @READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ @@ -34,7 +25,7 @@ @READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ @READLINE_TRUE@ tools/obex-server-tool.c -@@ -2658,13 +2658,13 @@ unit_tests = $(am__append_32) unit/test- +@@ -2667,17 +2667,17 @@ unit_tests = $(am__append_32) unit/test- @READLINE_TRUE@ client/display.h client/display.c @READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ @@ -48,5 +39,10 @@ -@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline +@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses + @READLINE_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c + @READLINE_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \ +-@READLINE_TRUE@ -lreadline ++@READLINE_TRUE@ -lreadline -lncurses + @EXPERIMENTAL_TRUE@tools_gatt_service_SOURCES = tools/gatt-service.c @EXPERIMENTAL_TRUE@tools_gatt_service_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ gdbus/libgdbus-internal.la From f325fafa2122a9feaa2ee99ed02584d547deb52b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sun, 6 Mar 2016 16:13:37 +0100 Subject: [PATCH 5/8] bluez: update to v5.37 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Fernández Rojas --- utils/bluez/Makefile | 6 +++--- utils/bluez/patches/201-readline.patch | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile index e7b504832f..5e375aab02 100644 --- a/utils/bluez/Makefile +++ b/utils/bluez/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2015 OpenWrt.org +# Copyright (C) 2006-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bluez -PKG_VERSION:=5.33 +PKG_VERSION:=5.37 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/ -PKG_MD5SUM:=78782dc33d9a8b6344c4cc1af70c8a98 +PKG_MD5SUM:=33177e5743e24b2b3738f72be64e3ffb PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING diff --git a/utils/bluez/patches/201-readline.patch b/utils/bluez/patches/201-readline.patch index 3d6ffaec33..45e155325c 100644 --- a/utils/bluez/patches/201-readline.patch +++ b/utils/bluez/patches/201-readline.patch @@ -1,6 +1,6 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -2405,7 +2405,7 @@ unit_tests = $(am__append_32) unit/test- +@@ -2441,7 +2441,7 @@ unit_tests = $(am__append_35) unit/test- @CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ @@ -9,7 +9,7 @@ @MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ @MONITOR_TRUE@ monitor/display.h monitor/display.c \ -@@ -2651,13 +2651,13 @@ unit_tests = $(am__append_32) unit/test- +@@ -2691,13 +2691,13 @@ unit_tests = $(am__append_35) unit/test- @READLINE_TRUE@ client/display.h @READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ @@ -25,7 +25,7 @@ @READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ @READLINE_TRUE@ tools/obex-server-tool.c -@@ -2667,17 +2667,17 @@ unit_tests = $(am__append_32) unit/test- +@@ -2707,17 +2707,17 @@ unit_tests = $(am__append_35) unit/test- @READLINE_TRUE@ client/display.h client/display.c @READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ From 506b35e97db665f33dc237953261a261e04793c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sun, 6 Mar 2016 16:20:24 +0100 Subject: [PATCH 6/8] bluez: Add support for Raspberry Pi 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adds bcm43xx-3wire variant. - Resets UART speed after firmware download. - Prints chip name when firmware isn't found for bcm43xx. - Increases timeout for bcm43xx. - Moves bcm43xx firmware to lib. Signed-off-by: Álvaro Fernández Rojas --- utils/bluez/Makefile | 2 +- ...01-bcm43xx-Add-bcm43xx-3wire-variant.patch | 21 ++++++++++++ ...-speed-must-be-reset-after-the-firmw.patch | 33 +++++++++++++++++++ ...ncrease-firmware-load-timeout-to-30s.patch | 20 +++++++++++ ...-the-43xx-firmware-into-lib-firmware.patch | 20 +++++++++++ 5 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch create mode 100644 utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch create mode 100644 utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch create mode 100644 utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile index 5e375aab02..177aa25bc5 100644 --- a/utils/bluez/Makefile +++ b/utils/bluez/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bluez PKG_VERSION:=5.37 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/ diff --git a/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch b/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch new file mode 100644 index 0000000000..96e8a26c59 --- /dev/null +++ b/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch @@ -0,0 +1,21 @@ +From b4f2b77472aeb967d3a7595e8a965785c7a37c87 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 16 Feb 2016 16:40:46 +0000 +Subject: [PATCH 1/4] bcm43xx: Add bcm43xx-3wire variant + +--- + tools/hciattach.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/tools/hciattach.c ++++ b/tools/hciattach.c +@@ -1144,6 +1144,9 @@ struct uart_t uart[] = { + { "bcm43xx", 0x0000, 0x0000, HCI_UART_H4, 115200, 3000000, + FLOW_CTL, DISABLE_PM, NULL, bcm43xx, NULL }, + ++ { "bcm43xx-3wire", 0x0000, 0x0000, HCI_UART_3WIRE, 115200, 3000000, ++ 0, DISABLE_PM, NULL, bcm43xx, NULL }, ++ + { "ath3k", 0x0000, 0x0000, HCI_UART_ATH3K, 115200, 115200, + FLOW_CTL, DISABLE_PM, NULL, ath3k_ps, ath3k_pm }, + diff --git a/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch b/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch new file mode 100644 index 0000000000..a221861d2c --- /dev/null +++ b/utils/bluez/patches/002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch @@ -0,0 +1,33 @@ +From e145c9621f976063e5c573db1f2053d906f63427 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 16 Feb 2016 16:39:09 +0000 +Subject: [PATCH 2/4] bcm43xx: The UART speed must be reset after the firmware + download + +--- + tools/hciattach_bcm43xx.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/tools/hciattach_bcm43xx.c ++++ b/tools/hciattach_bcm43xx.c +@@ -366,11 +366,8 @@ int bcm43xx_init(int fd, int def_speed, + return -1; + + if (bcm43xx_locate_patch(FIRMWARE_DIR, chip_name, fw_path)) { +- fprintf(stderr, "Patch not found, continue anyway\n"); ++ fprintf(stderr, "Patch not found for %s, continue anyway\n", chip_name); + } else { +- if (bcm43xx_set_speed(fd, ti, speed)) +- return -1; +- + if (bcm43xx_load_firmware(fd, fw_path)) + return -1; + +@@ -380,6 +377,7 @@ int bcm43xx_init(int fd, int def_speed, + return -1; + } + ++ sleep(1); + if (bcm43xx_reset(fd)) + return -1; + } diff --git a/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch b/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch new file mode 100644 index 0000000000..fa0948d921 --- /dev/null +++ b/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch @@ -0,0 +1,20 @@ +From d41dc2046dd08d8c95197f677e224506f5b39bdd Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 20 Jan 2016 16:00:37 +0000 +Subject: [PATCH 3/4] Increase firmware load timeout to 30s + +--- + tools/hciattach.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/hciattach.c ++++ b/tools/hciattach.c +@@ -1293,7 +1293,7 @@ int main(int argc, char *argv[]) + { + struct uart_t *u = NULL; + int detach, printpid, raw, opt, i, n, ld, err; +- int to = 10; ++ int to = 30; + int init_speed = 0; + int send_break = 0; + pid_t pid; diff --git a/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch b/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch new file mode 100644 index 0000000000..80b052d5b7 --- /dev/null +++ b/utils/bluez/patches/004-Move-the-43xx-firmware-into-lib-firmware.patch @@ -0,0 +1,20 @@ +From 76681284b0ea49852041fdb97a35175089a08781 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 23 Feb 2016 17:52:29 +0000 +Subject: [PATCH 4/4] Move the 43xx firmware into /lib/firmware + +--- + tools/hciattach_bcm43xx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/hciattach_bcm43xx.c ++++ b/tools/hciattach_bcm43xx.c +@@ -43,7 +43,7 @@ + #include "hciattach.h" + + #ifndef FIRMWARE_DIR +-#define FIRMWARE_DIR "/etc/firmware" ++#define FIRMWARE_DIR "/lib/firmware/brcm" + #endif + + #define FW_EXT ".hcd" From 8b99eb30b7fbcc91d2686095c8f5744a975cbcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Mon, 28 Mar 2016 14:53:35 +0200 Subject: [PATCH 7/8] bluez: update to v5.38 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/openwrt/packages/issues/2523 Closes https://github.com/openwrt/packages/pull/2545 Signed-off-by: Álvaro Fernández Rojas --- utils/bluez/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile index 177aa25bc5..0430cd6c1a 100644 --- a/utils/bluez/Makefile +++ b/utils/bluez/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bluez -PKG_VERSION:=5.37 -PKG_RELEASE:=2 +PKG_VERSION:=5.38 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/ -PKG_MD5SUM:=33177e5743e24b2b3738f72be64e3ffb +PKG_MD5SUM:=dae2ed00c63791800ea7d10a381270a5 PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING From e19f2e5c97d2d03cd8115aab279d869c77e72e84 Mon Sep 17 00:00:00 2001 From: Hirokazu MORIKAWA Date: Fri, 22 Sep 2017 15:51:37 +0900 Subject: [PATCH 8/8] bluez: bump to 5.47 fix CVE-2017-1000250 http://www.bluez.org/release-of-bluez-5-47/ Signed-off-by: Hirokazu MORIKAWA --- utils/bluez/Makefile | 9 ++-- utils/bluez/files/audio.conf | 1 + ...01-bcm43xx-Add-bcm43xx-3wire-variant.patch | 2 +- ...ncrease-firmware-load-timeout-to-30s.patch | 2 +- utils/bluez/patches/200-uart-speed.patch | 40 ----------------- utils/bluez/patches/201-readline.patch | 45 ++++++++++++------- 6 files changed, 36 insertions(+), 63 deletions(-) create mode 100644 utils/bluez/files/audio.conf delete mode 100644 utils/bluez/patches/200-uart-speed.patch diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile index 0430cd6c1a..1bff16ca1b 100644 --- a/utils/bluez/Makefile +++ b/utils/bluez/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bluez -PKG_VERSION:=5.38 +PKG_VERSION:=5.47 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/bluetooth/ -PKG_MD5SUM:=dae2ed00c63791800ea7d10a381270a5 +PKG_MD5SUM:=783e15f65e70cdb8f721c659e140dd56 PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING @@ -70,7 +70,7 @@ define Package/bluez-daemon/conffiles /etc/bluetooth/main.conf /etc/bluetooth/network.conf /etc/bluetooth/input.conf -/etc/bluetooth/proximity.conf +/etc/bluetooth/audio.conf /etc/config/bluetooth endef @@ -92,6 +92,7 @@ CONFIGURE_ARGS += \ --disable-systemd \ --disable-test \ --disable-udev \ + --enable-deprecated TARGET_CPPFLAGS += \ -D_GNU_SOURCE @@ -148,7 +149,7 @@ define Package/bluez-daemon/install $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf - $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/proximity/proximity.conf $(1)/etc/bluetooth/proximity.conf + $(INSTALL_DATA) ./files/audio.conf $(1)/etc/bluetooth/audio.conf $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd endef diff --git a/utils/bluez/files/audio.conf b/utils/bluez/files/audio.conf new file mode 100644 index 0000000000..0455c6c01b --- /dev/null +++ b/utils/bluez/files/audio.conf @@ -0,0 +1 @@ +Enable=Source,Sink,Media,Socket diff --git a/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch b/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch index 96e8a26c59..15eb6e1da8 100644 --- a/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch +++ b/utils/bluez/patches/001-bcm43xx-Add-bcm43xx-3wire-variant.patch @@ -9,7 +9,7 @@ Subject: [PATCH 1/4] bcm43xx: Add bcm43xx-3wire variant --- a/tools/hciattach.c +++ b/tools/hciattach.c -@@ -1144,6 +1144,9 @@ struct uart_t uart[] = { +@@ -1090,6 +1090,9 @@ struct uart_t uart[] = { { "bcm43xx", 0x0000, 0x0000, HCI_UART_H4, 115200, 3000000, FLOW_CTL, DISABLE_PM, NULL, bcm43xx, NULL }, diff --git a/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch b/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch index fa0948d921..74911d3cab 100644 --- a/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch +++ b/utils/bluez/patches/003-Increase-firmware-load-timeout-to-30s.patch @@ -9,7 +9,7 @@ Subject: [PATCH 3/4] Increase firmware load timeout to 30s --- a/tools/hciattach.c +++ b/tools/hciattach.c -@@ -1293,7 +1293,7 @@ int main(int argc, char *argv[]) +@@ -1239,7 +1239,7 @@ int main(int argc, char *argv[]) { struct uart_t *u = NULL; int detach, printpid, raw, opt, i, n, ld, err; diff --git a/utils/bluez/patches/200-uart-speed.patch b/utils/bluez/patches/200-uart-speed.patch deleted file mode 100644 index ebe0153e25..0000000000 --- a/utils/bluez/patches/200-uart-speed.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/tools/hciattach.c -+++ b/tools/hciattach.c -@@ -101,20 +101,37 @@ int uart_speed(int s) - return B230400; - case 460800: - return B460800; -+/* FIX: Not all platform support this high serial speed -+ claudyus84 @gamil.com -+*/ -+#ifdef B500000 - case 500000: - return B500000; -+#endif -+#ifdef B576000 - case 576000: - return B576000; -+#endif -+#ifdef B921600 - case 921600: - return B921600; -+#endif -+#ifdef B1000000 - case 1000000: - return B1000000; -+#endif -+#ifdef B1152000 - case 1152000: - return B1152000; -+#endif -+#ifdef B1500000 - case 1500000: - return B1500000; -+#endif -+#ifdef B2000000 - case 2000000: - return B2000000; -+#endif - #ifdef B2500000 - case 2500000: - return B2500000; diff --git a/utils/bluez/patches/201-readline.patch b/utils/bluez/patches/201-readline.patch index 45e155325c..5794371620 100644 --- a/utils/bluez/patches/201-readline.patch +++ b/utils/bluez/patches/201-readline.patch @@ -1,22 +1,24 @@ ---- a/Makefile.in -+++ b/Makefile.in -@@ -2441,7 +2441,7 @@ unit_tests = $(am__append_35) unit/test- +--- a/Makefile.in 2017-09-14 11:47:06.000000000 +0200 ++++ b/Makefile.in 2017-09-15 02:52:39.315926972 +0200 +@@ -2447,7 +2447,7 @@ @CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c - @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ --@CLIENT_TRUE@ -lreadline -+@CLIENT_TRUE@ -lreadline -lncurses + @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \ +-@CLIENT_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline ++@CLIENT_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses + + @MESH_TRUE@mesh_meshctl_SOURCES = mesh/main.c \ + @MESH_TRUE@ mesh/mesh-net.h \ +@@ -2468,7 +2468,7 @@ + + @MESH_TRUE@mesh_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \ + @MESH_TRUE@ lib/libbluetooth-internal.la \ +-@MESH_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -ljson-c -lreadline ++@MESH_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -ljson-c -lreadline -lncurses @MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ @MONITOR_TRUE@ monitor/display.h monitor/display.c \ -@@ -2691,13 +2691,13 @@ unit_tests = $(am__append_35) unit/test- - @READLINE_TRUE@ client/display.h - - @READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ --@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline -+@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline -lncurses - - @READLINE_TRUE@tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \ +@@ -2724,7 +2724,7 @@ @READLINE_TRUE@ tools/obex-client-tool.c @READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \ @@ -25,7 +27,7 @@ @READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ @READLINE_TRUE@ tools/obex-server-tool.c -@@ -2707,17 +2707,17 @@ unit_tests = $(am__append_35) unit/test- +@@ -2734,17 +2734,17 @@ @READLINE_TRUE@ client/display.h client/display.c @READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ @@ -44,5 +46,14 @@ -@READLINE_TRUE@ -lreadline +@READLINE_TRUE@ -lreadline -lncurses - @EXPERIMENTAL_TRUE@tools_gatt_service_SOURCES = tools/gatt-service.c - @EXPERIMENTAL_TRUE@tools_gatt_service_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ gdbus/libgdbus-internal.la + @DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \ + @DEPRECATED_TRUE@@READLINE_TRUE@ attrib/gattrib.c btio/btio.c \ +@@ -2753,7 +2753,7 @@ + @DEPRECATED_TRUE@@READLINE_TRUE@ client/display.h + + @DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ +-@DEPRECATED_TRUE@@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline ++@DEPRECATED_TRUE@@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline -lncurses + + @CUPS_TRUE@cupsdir = $(libdir)/cups/backend + @CUPS_TRUE@profiles_cups_bluetooth_SOURCES = profiles/cups/main.c \