public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Leonardo Costa <leoreis.costa@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Leonardo Costa <leonardo.costa@toradex.com>
Subject: [PATCH] bluez5: add patches to fix 8.56 cli issues
Date: Thu, 23 Apr 2026 09:40:30 -0300	[thread overview]
Message-ID: <20260423124205.24189-1-leoreis.costa@gmail.com> (raw)

From: Leonardo Costa <leonardo.costa@toradex.com>

On bluez5 5.86, the bluetoothctl cli interface does not work outside of
the dedicated shell to list controllers and devices [1]. These patches fix
the issue while version 5.87 is not published.

[1] https://github.com/bluez/bluez/issues/1896

Upstream-Status: Backport [https://github.com/bluez/bluez/commit/b33e923b55e4d0e9d78a83cfcb541fd1f687ef54,
                           https://github.com/bluez/bluez/commit/21e13976f2e375d701b8b7032ba5c1b2e56c305f]

Signed-off-by: Leonardo Costa <leonardo.costa@toradex.com>
---
 meta/recipes-connectivity/bluez5/bluez5.inc   |  2 +
 ...ell-Don-t-init-input-for-non-interac.patch | 42 +++++++++++++++++++
 ...d-broken-stdin-handling-in-home-made.patch | 36 ++++++++++++++++
 3 files changed, 80 insertions(+)
 create mode 100644 meta/recipes-connectivity/bluez5/bluez5/0001-Revert-shared-shell-Don-t-init-input-for-non-interac.patch
 create mode 100644 meta/recipes-connectivity/bluez5/bluez5/0001-tools-Work-around-broken-stdin-handling-in-home-made.patch

diff --git a/meta/recipes-connectivity/bluez5/bluez5.inc b/meta/recipes-connectivity/bluez5/bluez5.inc
index dd20583015..843e36b78d 100644
--- a/meta/recipes-connectivity/bluez5/bluez5.inc
+++ b/meta/recipes-connectivity/bluez5/bluez5.inc
@@ -68,6 +68,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
            file://init \
            file://run-ptest \
            file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
+           file://0001-Revert-shared-shell-Don-t-init-input-for-non-interac.patch \
+           file://0001-tools-Work-around-broken-stdin-handling-in-home-made.patch \
            "
 S = "${UNPACKDIR}/bluez-${PV}"
 
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-Revert-shared-shell-Don-t-init-input-for-non-interac.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-Revert-shared-shell-Don-t-init-input-for-non-interac.patch
new file mode 100644
index 0000000000..a0271513eb
--- /dev/null
+++ b/meta/recipes-connectivity/bluez5/bluez5/0001-Revert-shared-shell-Don-t-init-input-for-non-interac.patch
@@ -0,0 +1,42 @@
+From b33e923b55e4d0e9d78a83cfcb541fd1f687ef54 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Fri, 27 Feb 2026 12:27:17 +0100
+Subject: [PATCH] Revert "shared/shell: Don't init input for non-interactive
+ shells"
+
+This reverts commit e73bf582dae60356641a32fc27ae03d359ec4c47.
+
+The fix caused "bluetoothctl list" to not output any text, breaking
+a lot of existing scripts.
+
+Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2440346
+
+Upstream-Status: Backport [https://github.com/bluez/bluez/commit/b33e923b55e4d0e9d78a83cfcb541fd1f687ef54]
+Signed-off-by: Leonardo Costa <leonardo.costa@toradex.com>
+---
+ src/shared/shell.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/shared/shell.c b/src/shared/shell.c
+index 78d58c513..b061f8001 100644
+--- a/src/shared/shell.c
++++ b/src/shared/shell.c
+@@ -1642,13 +1642,13 @@ static bool shell_quit(void *data)
+ 
+ bool bt_shell_attach(int fd)
+ {
+-	if (data.mode == MODE_INTERACTIVE) {
+-		struct input *input;
++	struct input *input;
+ 
+-		input = input_new(fd);
+-		if (!input)
+-			return false;
++	input = input_new(fd);
++	if (!input)
++		return false;
+ 
++	if (data.mode == MODE_INTERACTIVE) {
+ 		io_set_read_handler(input->io, input_read, input, NULL);
+ 		io_set_disconnect_handler(input->io, input_hup, input, NULL);
+ 
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-tools-Work-around-broken-stdin-handling-in-home-made.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-tools-Work-around-broken-stdin-handling-in-home-made.patch
new file mode 100644
index 0000000000..c362936bc2
--- /dev/null
+++ b/meta/recipes-connectivity/bluez5/bluez5/0001-tools-Work-around-broken-stdin-handling-in-home-made.patch
@@ -0,0 +1,36 @@
+From 21e13976f2e375d701b8b7032ba5c1b2e56c305f Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Fri, 27 Feb 2026 12:27:18 +0100
+Subject: [PATCH] tools: Work-around broken stdin handling in home-made
+ mainloop
+
+bluetoothd has 3 mainloop implementations, one relying on ell, one
+relying on glib, and another home-made.
+
+The home-made mainloop handler use epoll() without any fallbacks, and
+will hang if one tries to epoll() an stdin that redirects from
+/dev/null.
+
+Closes: https://github.com/bluez/bluez/issues/700
+
+Upstream-Status: Backport [https://github.com/bluez/bluez/commit/b33e923b55e4d0e9d78a83cfcb541fd1f687ef54]
+Signed-off-by: Leonardo Costa <leonardo.costa@toradex.com>
+---
+ Makefile.tools | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.tools b/Makefile.tools
+index 589f7c94f..7c52e053f 100644
+--- a/Makefile.tools
++++ b/Makefile.tools
+@@ -531,8 +531,8 @@ tools_obexctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
+ 
+ tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c \
+ 			client/mgmt.c
+-tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \
+-				-lreadline
++tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-glib.la \
++				$(GLIB_LIBS) -lreadline
+ if DEPRECATED
+ noinst_PROGRAMS += attrib/gatttool
+ 


                 reply	other threads:[~2026-04-23 12:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260423124205.24189-1-leoreis.costa@gmail.com \
    --to=leoreis.costa@gmail.com \
    --cc=leonardo.costa@toradex.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox