From 8d0c834fc9661d18b35645632c28212e1f1cbe97 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Sat, 18 May 2024 14:03:17 +0000 Subject: [PATCH] bluez: update to 5.83 --- packages/network/bluez/package.mk | 4 +- .../patches/bluez-01_add-obexd-policy.patch | 2 +- .../bluez-02_obexd-use-system-bus.patch | 25 ---------- ...ixaxis-fix-PID-navigation-controller.patch | 6 +-- .../bluez-12-fix-obexd-after-5_73.patch | 16 +++--- ...iattach-add-QCA9377-Tuffello-support.patch | 14 +++--- .../bluez-22-Revert-build-Fix-distcheck.patch | 50 ------------------- ...crash-if-bt_uhid_destroy-free-replay.patch | 45 ----------------- packages/network/bluez/system.d/obex.service | 2 +- 9 files changed, 22 insertions(+), 142 deletions(-) delete mode 100644 packages/network/bluez/patches/bluez-02_obexd-use-system-bus.patch delete mode 100644 packages/network/bluez/patches/bluez-22-Revert-build-Fix-distcheck.patch delete mode 100644 packages/network/bluez/patches/bluez-50-shared-uhid--Fix-crash-if-bt_uhid_destroy-free-replay.patch diff --git a/packages/network/bluez/package.mk b/packages/network/bluez/package.mk index ea8d57bbbd..3ccdd59908 100644 --- a/packages/network/bluez/package.mk +++ b/packages/network/bluez/package.mk @@ -3,8 +3,8 @@ # Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) PKG_NAME="bluez" -PKG_VERSION="5.75" -PKG_SHA256="988cb3c4551f6e3a667708a578f5ca9f93fc896508f98f08709be4f8ab033c2f" +PKG_VERSION="5.83" +PKG_SHA256="108522d909d220581399bfec93daab62035539ceef3dda3e79970785c63bd24c" PKG_LICENSE="GPL" PKG_SITE="http://www.bluez.org/" PKG_URL="https://www.kernel.org/pub/linux/bluetooth/${PKG_NAME}-${PKG_VERSION}.tar.xz" diff --git a/packages/network/bluez/patches/bluez-01_add-obexd-policy.patch b/packages/network/bluez/patches/bluez-01_add-obexd-policy.patch index 1517d65a3d..6fd94b998e 100644 --- a/packages/network/bluez/patches/bluez-01_add-obexd-policy.patch +++ b/packages/network/bluez/patches/bluez-01_add-obexd-policy.patch @@ -2,7 +2,7 @@ diff --git a/src/bluetooth.conf b/src/bluetooth.conf index 8a1e258..31b7542 100644 --- a/src/bluetooth.conf +++ b/src/bluetooth.conf -@@ -20,10 +20,24 @@ +@@ -21,10 +21,24 @@ diff --git a/packages/network/bluez/patches/bluez-02_obexd-use-system-bus.patch b/packages/network/bluez/patches/bluez-02_obexd-use-system-bus.patch deleted file mode 100644 index dd52a299ea..0000000000 --- a/packages/network/bluez/patches/bluez-02_obexd-use-system-bus.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 20dfa1079c088236bcd63f1a986956b488177ebf Mon Sep 17 00:00:00 2001 -From: Stefan Saraev -Date: Tue, 6 Aug 2013 11:18:09 +0300 -Subject: [PATCH] obexd: use system bus - ---- - obexd/src/manager.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/obexd/src/manager.c b/obexd/src/manager.c -index dbfbef8..9a29f8c 100644 ---- a/obexd/src/manager.c -+++ b/obexd/src/manager.c -@@ -569,7 +569,7 @@ gboolean manager_init(void) - - dbus_error_init(&err); - -- connection = g_dbus_setup_bus(DBUS_BUS_SESSION, OBEXD_SERVICE, &err); -+ connection = g_dbus_setup_bus(DBUS_BUS_SYSTEM, OBEXD_SERVICE, &err); - if (connection == NULL) { - if (dbus_error_is_set(&err) == TRUE) { - fprintf(stderr, "%s\n", err.message); --- -1.7.2.5 - diff --git a/packages/network/bluez/patches/bluez-11_sixaxis-fix-PID-navigation-controller.patch b/packages/network/bluez/patches/bluez-11_sixaxis-fix-PID-navigation-controller.patch index 12cf6a8b57..d3de493f2e 100644 --- a/packages/network/bluez/patches/bluez-11_sixaxis-fix-PID-navigation-controller.patch +++ b/packages/network/bluez/patches/bluez-11_sixaxis-fix-PID-navigation-controller.patch @@ -17,7 +17,7 @@ diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c index 939fed7..f6baea7 100644 --- a/plugins/sixaxis.c +++ b/plugins/sixaxis.c -@@ -364,7 +364,13 @@ static bool setup_device(int fd, const char *sysfs_path, +@@ -354,7 +354,13 @@ static bool setup_device(int fd, const char *sysfs_path, info("sixaxis: setting up new device"); btd_device_device_set_name(device, cp->name); @@ -36,7 +36,7 @@ diff --git a/profiles/input/sixaxis.h b/profiles/input/sixaxis.h index 8e6f3cc..321a918 100644 --- a/profiles/input/sixaxis.h +++ b/profiles/input/sixaxis.h -@@ -38,6 +38,7 @@ struct cable_pairing { +@@ -25,6 +25,7 @@ struct cable_pairing { uint16_t vid; uint16_t pid; uint16_t version; @@ -44,7 +44,7 @@ index 8e6f3cc..321a918 100644 CablePairingType type; }; -@@ -59,6 +60,7 @@ get_pairing(uint16_t vid, uint16_t pid) +@@ -54,6 +55,7 @@ get_pairing(uint16_t vid, uint16_t pid) .vid = 0x054c, .pid = 0x042f, .version = 0x0000, diff --git a/packages/network/bluez/patches/bluez-12-fix-obexd-after-5_73.patch b/packages/network/bluez/patches/bluez-12-fix-obexd-after-5_73.patch index 8b2e0e52fa..4023c97bd5 100644 --- a/packages/network/bluez/patches/bluez-12-fix-obexd-after-5_73.patch +++ b/packages/network/bluez/patches/bluez-12-fix-obexd-after-5_73.patch @@ -7,9 +7,9 @@ index b7e9f2d33..9a9e9a0a0 100644 -if OBEX - if SYSTEMD - systemduserunitdir = $(SYSTEMD_USERUNITDIR) - systemduserunit_DATA = obexd/src/obex.service -@@ -41,6 +39,8 @@ obexd_builtin_sources += obexd/plugins/opp.c + systemduserunit_DATA += obexd/src/obex.service + +@@ -40,6 +38,8 @@ obexd_builtin_sources += obexd/plugins/opp.c obexd_builtin_modules += ftp obexd_builtin_sources += obexd/plugins/ftp.c obexd/plugins/ftp.h @@ -18,7 +18,7 @@ index b7e9f2d33..9a9e9a0a0 100644 obexd_builtin_modules += irmc obexd_builtin_sources += obexd/plugins/irmc.c -@@ -57,6 +57,8 @@ obexd_builtin_sources += obexd/plugins/mas.c obexd/src/map_ap.h \ +@@ -56,6 +56,8 @@ obexd_builtin_sources += obexd/plugins/mas.c obexd/src/map_ap.h \ obexd/plugins/messages.h \ obexd/plugins/messages-dummy.c @@ -27,7 +27,7 @@ index b7e9f2d33..9a9e9a0a0 100644 obexd_builtin_modules += mns obexd_builtin_sources += obexd/client/mns.c obexd/src/map_ap.h \ obexd/client/map-event.h -@@ -103,11 +105,6 @@ obexd_src_obexd_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) \ +@@ -107,11 +109,6 @@ obexd_src_obexd_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) \ -D_FILE_OFFSET_BITS=64 \ -I$(builddir)/obexd/src @@ -36,6 +36,6 @@ index b7e9f2d33..9a9e9a0a0 100644 -obexd-remove-service-symlink: -endif - - obexd_src_obexd_SHORTNAME = obexd - - obexd_builtin_files = obexd/src/builtin.h $(obexd_builtin_nodist) + if OBEX + if SYSTEMD + obexd_src_obexd_CPPFLAGS += -DSYSTEMD diff --git a/packages/network/bluez/patches/bluez-21-hciattach-add-QCA9377-Tuffello-support.patch b/packages/network/bluez/patches/bluez-21-hciattach-add-QCA9377-Tuffello-support.patch index 98355a6126..86839fa62c 100644 --- a/packages/network/bluez/patches/bluez-21-hciattach-add-QCA9377-Tuffello-support.patch +++ b/packages/network/bluez/patches/bluez-21-hciattach-add-QCA9377-Tuffello-support.patch @@ -33,7 +33,7 @@ diff --git a/Makefile.tools b/Makefile.tools index b7b422506..e0e995089 100644 --- a/Makefile.tools +++ b/Makefile.tools -@@ -304,6 +304,7 @@ tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \ +@@ -417,6 +417,7 @@ tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \ tools/hciattach_ti.c \ tools/hciattach_tialt.c \ tools/hciattach_ath3k.c \ @@ -45,7 +45,7 @@ diff --git a/android/Android.mk b/android/Android.mk index 76a826b47..01599c04b 100644 --- a/android/Android.mk +++ b/android/Android.mk -@@ -696,6 +696,7 @@ LOCAL_SRC_FILES := \ +@@ -697,6 +697,7 @@ LOCAL_SRC_FILES := \ bluez/tools/hciattach_ti.c \ bluez/tools/hciattach_tialt.c \ bluez/tools/hciattach_ath3k.c \ @@ -57,7 +57,7 @@ diff --git a/tools/hciattach.c b/tools/hciattach.c index fad176c9b..02a65c692 100644 --- a/tools/hciattach.c +++ b/tools/hciattach.c -@@ -263,6 +263,11 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti) +@@ -252,6 +252,11 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti) return ath3k_post(fd, u->pm); } @@ -69,7 +69,7 @@ index fad176c9b..02a65c692 100644 static int qualcomm(int fd, struct uart_t *u, struct termios *ti) { return qualcomm_init(fd, u->speed, ti, u->bdaddr); -@@ -1093,6 +1098,10 @@ struct uart_t uart[] = { +@@ -1082,6 +1087,10 @@ struct uart_t uart[] = { { "ath3k", 0x0000, 0x0000, HCI_UART_ATH3K, 115200, 115200, FLOW_CTL, DISABLE_PM, NULL, ath3k_ps, ath3k_pm }, @@ -80,7 +80,7 @@ index fad176c9b..02a65c692 100644 /* QUALCOMM BTS */ { "qualcomm", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, DISABLE_PM, NULL, qualcomm, NULL }, -@@ -1145,6 +1154,9 @@ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw) +@@ -1134,6 +1143,9 @@ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw) if (u->flags & AMP_DEV) flags |= 1 << HCI_UART_CREATE_AMP; @@ -94,7 +94,7 @@ diff --git a/tools/hciattach.h b/tools/hciattach.h index 249aab49e..85c801ccf 100644 --- a/tools/hciattach.h +++ b/tools/hciattach.h -@@ -65,6 +65,7 @@ int bgb2xx_init(int dd, bdaddr_t *bdaddr); +@@ -56,6 +56,7 @@ int bgb2xx_init(int dd, bdaddr_t *bdaddr); int ath3k_init(int fd, int speed, int init_speed, char *bdaddr, struct termios *ti); int ath3k_post(int fd, int pm); @@ -953,7 +953,7 @@ index 000000000..9a7f222c4 + return ret; + } + -+ while (getline(&line, &bytes_read, pfile) > 0 ) { ++ while (getline(&line, (size_t *)&bytes_read, pfile) > 0 ) { + if (line[0] != '#' && line[0] != '\n') { + pch = memchr(line, '=', strlen(line)); + if (pch != NULL) { diff --git a/packages/network/bluez/patches/bluez-22-Revert-build-Fix-distcheck.patch b/packages/network/bluez/patches/bluez-22-Revert-build-Fix-distcheck.patch deleted file mode 100644 index 532a16701f..0000000000 --- a/packages/network/bluez/patches/bluez-22-Revert-build-Fix-distcheck.patch +++ /dev/null @@ -1,50 +0,0 @@ -From e679b29bcf4890d61294e4110bace5f783632e5a Mon Sep 17 00:00:00 2001 -From: Rudi Heitbaum -Date: Sat, 9 Mar 2024 08:55:24 +0000 -Subject: [PATCH] Revert "build: Fix distcheck" - -This reverts commit d5a9195a6269e703c6e3a47c40982ec94d8cc838. ---- - Makefile.tools | 6 +----- - configure.ac | 8 +------- - 2 files changed, 2 insertions(+), 12 deletions(-) - -diff --git a/Makefile.tools b/Makefile.tools -index 27a753762..c17244677 100644 ---- a/Makefile.tools -+++ b/Makefile.tools -@@ -539,11 +539,7 @@ endif - - if CUPS - --if CUPS_SERVERBIN --cupsdir = $(CUPS_SERVERBIN)/backend --else --cupsdir = $(libdir)/cups/backend --endif -+cupsdir = $(CUPSDIR) - - cups_PROGRAMS = profiles/cups/bluetooth - -diff --git a/configure.ac b/configure.ac -index 9ebc250cf..0190e8271 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -247,13 +247,7 @@ AC_ARG_ENABLE(cups, AS_HELP_STRING([--disable-cups], - [disable CUPS printer support]), [enable_cups=${enableval}]) - AM_CONDITIONAL(CUPS, test "${enable_cups}" != "no") - if (test "${enable_cups}" != "no"); then -- AC_MSG_CHECKING([cups directory]) -- cups_serverbin=`$PKG_CONFIG cups --variable=cups_serverbin` -- AM_CONDITIONAL(CUPS_SERVERBIN, test "${cups_serverbin}" != "") -- if (test "${cups_serverbin}" != ""); then -- AC_SUBST(CUPS_SERVERBIN, ${cups_serverbin}) -- fi -- AC_MSG_RESULT([${cups_serverbin}]) -+ AC_SUBST(CUPSDIR, `$PKG_CONFIG cups --variable=cups_serverbin`/backend) - fi - - AC_ARG_ENABLE(mesh, AS_HELP_STRING([--enable-mesh], --- -2.43.0 - diff --git a/packages/network/bluez/patches/bluez-50-shared-uhid--Fix-crash-if-bt_uhid_destroy-free-replay.patch b/packages/network/bluez/patches/bluez-50-shared-uhid--Fix-crash-if-bt_uhid_destroy-free-replay.patch deleted file mode 100644 index 129c7b0456..0000000000 --- a/packages/network/bluez/patches/bluez-50-shared-uhid--Fix-crash-if-bt_uhid_destroy-free-replay.patch +++ /dev/null @@ -1,45 +0,0 @@ -From b94f1be656f34ea1363f5566ef63b847234c6dea Mon Sep 17 00:00:00 2001 -From: Luiz Augusto von Dentz -Date: Mon, 15 Apr 2024 10:48:58 -0400 -Subject: [PATCH] shared/uhid: Fix crash if bt_uhid_destroy free replay - structure - -Id replay structured has been allocated it shall be set back to NULL -after calling uhid_replay_free otherwise it may cause the following -crash: - -Invalid read of size 1 - at 0x1D8FC4: bt_uhid_record (uhid.c:116) - by 0x1D912C: uhid_read_handler (uhid.c:158) - by 0x201A64: watch_callback (io-glib.c:157) - by 0x48D4198: g_main_dispatch.lto_priv.0 (gmain.c:3344) - by 0x49333BE: UnknownInlinedFun (gmain.c:4152) - by 0x49333BE: g_main_context_iterate_unlocked.isra.0 (gmain.c:4217) - by 0x48D4DC6: g_main_loop_run (gmain.c:4419) - by 0x2020F4: mainloop_run (mainloop-glib.c:66) - by 0x20254B: mainloop_run_with_signal (mainloop-notify.c:188) - by 0x12D6D4: main (main.c:1456) - Address 0x53ae9c0 is 0 bytes inside a block of size 40 free'd - at 0x48468CF: free (vg_replace_malloc.c:985) - by 0x1D8E19: uhid_replay_free (uhid.c:68) - by 0x1D8E19: uhid_replay_free (uhid.c:59) - by 0x1D8E19: bt_uhid_destroy (uhid.c:509) - by 0x1591F5: uhid_disconnect (device.c:183) - -Fixes: https://github.com/bluez/bluez/issues/815 ---- - src/shared/uhid.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/shared/uhid.c b/src/shared/uhid.c -index c1092b707..1f071b958 100644 ---- a/src/shared/uhid.c -+++ b/src/shared/uhid.c -@@ -507,6 +507,7 @@ int bt_uhid_destroy(struct bt_uhid *uhid) - - uhid->created = false; - uhid_replay_free(uhid->replay); -+ uhid->replay = NULL; - - return err; - } diff --git a/packages/network/bluez/system.d/obex.service b/packages/network/bluez/system.d/obex.service index 919d75babd..9ae85bfa5f 100644 --- a/packages/network/bluez/system.d/obex.service +++ b/packages/network/bluez/system.d/obex.service @@ -10,7 +10,7 @@ ConditionPathExists=/storage/.cache/services/bluez.conf EnvironmentFile=/storage/.cache/services/obexd.conf EnvironmentFile=-/run/libreelec/debug/obexd.conf ExecStartPre=/bin/sh -c 'mkdir -p $OBEXD_ROOT' -ExecStart=/usr/lib/bluetooth/obexd -r $OBEXD_ROOT $OBEXD_DEBUG +ExecStart=/usr/lib/bluetooth/obexd -s -r $OBEXD_ROOT $OBEXD_DEBUG TimeoutStopSec=1s [Install]