import CS bluez-5.83-2.el9

This commit is contained in:
eabdullin 2025-09-25 08:35:31 +00:00
parent 78de5238c9
commit 7a084d8d9d
5 changed files with 200 additions and 88 deletions

View File

@ -1 +1 @@
6c73541f2cd27543b66741d16d520970d8877940 SOURCES/bluez-5.72.tar.xz
ad4823acf2906e38b77305a329654e1f0bce0263 SOURCES/bluez-5.83.tar.xz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/bluez-5.72.tar.xz
SOURCES/bluez-5.83.tar.xz

174
SOURCES/5.83-fixes.patch Normal file
View File

@ -0,0 +1,174 @@
From a3a1298c0f4e2387694ad7ecd952cbd0a0b82c83 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Thu, 3 Jul 2025 13:30:22 -0400
Subject: [PATCH 1/2] shared/shell: Fix not calling pre_run for main menu
When calling bt_shell_run the main menu pre_run was not being called
which cause tools with just one menu to not work as intended.
Fixes: https://github.com/bluez/bluez/issues/1319
---
src/shared/shell.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/shared/shell.c b/src/shared/shell.c
index 3e5959fc1868..c69748594955 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -1449,6 +1449,9 @@ int bt_shell_run(void)
int status;
const struct queue_entry *submenu;
+ if (data.menu && data.menu->pre_run)
+ data.menu->pre_run(data.menu);
+
for (submenu = queue_get_entries(data.submenus); submenu;
submenu = submenu->next) {
struct bt_shell_menu *menu = submenu->data;
--
2.50.1
From a7ce88a861a0a26b50987ff455f0bb61379aa89c Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Mon, 7 Jul 2025 09:39:43 -0400
Subject: [PATCH 2/2] shared/shell: Fix not running pre_run on
MODE_NON_INTERACTIVE
If a command is given to be run in non-interactive mode the code would
not attempt to execute .pre_run first since some (sub)menus requires that
in order to properly initialize things.
Fixes: https://github.com/bluez/bluez/issues/1394
Fixes: https://github.com/bluez/bluez/issues/1317
---
src/shared/shell.c | 33 +++++++++++++++++++++++----------
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/src/shared/shell.c b/src/shared/shell.c
index c69748594955..694ddc0007f5 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -423,7 +423,8 @@ static void cmd_script(int argc, char *argv[])
return bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static const struct bt_shell_menu_entry default_menu[] = {
+static const struct bt_shell_menu default_menu = {
+ .entries = {
{ "back", NULL, cmd_back, "Return to main menu", NULL,
NULL, cmd_back_exists },
{ "menu", "<name>", cmd_menu, "Select submenu",
@@ -437,7 +438,7 @@ static const struct bt_shell_menu_entry default_menu[] = {
{ "export", NULL, cmd_export,
"Print environment variables" },
{ "script", "<filename>", cmd_script, "Run script" },
- { }
+ {} },
};
static void shell_print_help(void)
@@ -480,7 +481,7 @@ static void shell_print_menu(void)
print_menu(entry->cmd, entry->arg ? : "", entry->desc ? : "");
}
- for (entry = default_menu; entry->cmd; entry++) {
+ for (entry = default_menu.entries; entry->cmd; entry++) {
if (entry->exists && !entry->exists(data.menu))
continue;
@@ -495,7 +496,7 @@ static void shell_print_menu_zsh_complete(void)
for (entry = data.menu->entries; entry->cmd; entry++)
printf("%s:%s\n", entry->cmd, entry->desc ? : "");
- for (entry = default_menu; entry->cmd; entry++) {
+ for (entry = default_menu.entries; entry->cmd; entry++) {
if (entry->exists && !entry->exists(data.menu))
continue;
@@ -627,9 +628,11 @@ fail:
return -EINVAL;
}
-static int menu_exec(const struct bt_shell_menu_entry *entry,
+static int menu_exec(const struct bt_shell_menu *menu,
int argc, char *argv[])
{
+ const struct bt_shell_menu_entry *entry = menu->entries;
+
for (; entry->cmd; entry++) {
if (strcmp(argv[0], entry->cmd))
continue;
@@ -642,6 +645,9 @@ static int menu_exec(const struct bt_shell_menu_entry *entry,
if (data.menu == data.main && !strcmp(entry->cmd, "back"))
continue;
+ if (data.mode == MODE_NON_INTERACTIVE && menu->pre_run)
+ menu->pre_run(menu);
+
return cmd_exec(entry, argc, argv);
}
@@ -673,7 +679,7 @@ static int submenu_exec(int argc, char *argv[])
memmove(argv[0], argv[0] + len + 1, tlen - len - 1);
memset(argv[0] + tlen - len - 1, 0, len + 1);
- return menu_exec(submenu->entries, argc, argv);
+ return menu_exec(submenu, argc, argv);
}
static int shell_exec(int argc, char *argv[])
@@ -686,9 +692,9 @@ static int shell_exec(int argc, char *argv[])
if (!argsisutf8(argc, argv))
return -EINVAL;
- err = menu_exec(default_menu, argc, argv);
+ err = menu_exec(&default_menu, argc, argv);
if (err == -ENOENT) {
- err = menu_exec(data.menu->entries, argc, argv);
+ err = menu_exec(data.menu, argc, argv);
if (err == -ENOENT) {
err = submenu_exec(argc, argv);
if (err == -ENOENT) {
@@ -980,7 +986,7 @@ static char *cmd_generator(const char *text, int state)
}
if (default_menu_enabled) {
- cmd = find_cmd(text, default_menu, &index);
+ cmd = find_cmd(text, default_menu.entries, &index);
if (cmd) {
return cmd;
} else {
@@ -1171,7 +1177,7 @@ static char **shell_completion(const char *text, int start, int end)
if (wordexp(rl_line_buffer, &w, WRDE_NOCMD))
return NULL;
- matches = menu_completion(default_menu, text, w.we_wordc,
+ matches = menu_completion(default_menu.entries, text, w.we_wordc,
w.we_wordv[0]);
if (!matches) {
matches = menu_completion(data.menu->entries, text,
@@ -1449,6 +1455,12 @@ int bt_shell_run(void)
int status;
const struct queue_entry *submenu;
+ /* Check if on non-interactive mode skip pre-run since that is on-demand
+ * by shell_exec() only for the menu in use.
+ */
+ if (data.mode == MODE_NON_INTERACTIVE)
+ goto done;
+
if (data.menu && data.menu->pre_run)
data.menu->pre_run(data.menu);
@@ -1460,6 +1472,7 @@ int bt_shell_run(void)
menu->pre_run(menu);
}
+done:
status = mainloop_run_with_signal(signal_callback, NULL);
bt_shell_cleanup();
--
2.50.1

View File

@ -1,81 +0,0 @@
From 42043c35ac62dcf3b880974b3d0fb762583733ff Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 27 Nov 2024 12:49:52 +0100
Subject: [PATCH 1/2] profiles/audio: Quiet plug-in warnings
A normal daemon start should not throw warnings on a system in the
default configuration. Quiet the plug-in warnings that require
experimental features to be enabled. They will still appear in the debug
output.
bluetoothd[896]: profiles/audio/micp.c:micp_init() D-Bus experimental not enabled
---
profiles/audio/media.c | 2 +-
profiles/audio/micp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 1faa1c28969f..efd1d667c270 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -1214,7 +1214,7 @@ static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type,
char *name;
if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) {
- warn("D-Bus experimental not enabled");
+ DBG("D-Bus experimental not enabled");
*err = -ENOTSUP;
return false;
}
diff --git a/profiles/audio/micp.c b/profiles/audio/micp.c
index 452027c75da2..3f0845dcb328 100644
--- a/profiles/audio/micp.c
+++ b/profiles/audio/micp.c
@@ -318,7 +318,7 @@ static unsigned int micp_id;
static int micp_init(void)
{
if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) {
- warn("D-Bus experimental not enabled");
+ DBG("D-Bus experimental not enabled");
return -ENOTSUP;
}
--
2.48.1
From bca2b4b7d69df7158dc1024c4bf7510ff771f189 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 27 Nov 2024 12:49:53 +0100
Subject: [PATCH 2/2] plugin: Quiet start-up warnings
It's not an error for a plug-in not to start if the hardware doesn't
support it. Quiet the warnings that require specific hardware.
The messages will still appear in the debug output.
bluetoothd[896]: src/plugin.c:plugin_init() System does not support csip plugin
bluetoothd[896]: src/plugin.c:plugin_init() System does not support micp plugin
bluetoothd[896]: src/plugin.c:plugin_init() System does not support vcp plugin
bluetoothd[896]: src/plugin.c:plugin_init() System does not support mcp plugin
bluetoothd[896]: src/plugin.c:plugin_init() System does not support bass plugin
bluetoothd[896]: src/plugin.c:plugin_init() System does not support bap plugin
---
src/plugin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugin.c b/src/plugin.c
index 80990f8c3c7e..42ed75ab31f3 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -187,7 +187,7 @@ start:
err = plugin->desc->init();
if (err < 0) {
if (err == -ENOSYS || err == -ENOTSUP)
- warn("System does not support %s plugin",
+ DBG("System does not support %s plugin",
plugin->desc->name);
else
error("Failed to init %s plugin",
--
2.48.1

View File

@ -5,8 +5,8 @@
%endif
Name: bluez
Version: 5.72
Release: 4%{?dist}
Version: 5.83
Release: 2%{?dist}
Summary: Bluetooth utilities
License: GPLv2+
URL: http://www.bluez.org/
@ -18,9 +18,8 @@ Source1: bluez.gitignore
Patch1: 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
# https://patchwork.kernel.org/project/bluetooth/patch/20240214155019.325715-1-hadess@hadess.net/
Patch2: 0001-Add-missing-mesh-gatt-JSON-files.patch
# https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=fdcde2ce2112df852ab3df6e49b158621177f946
# https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=252883241228f3149566f119336ce2c49a8d861e
Patch3: plugin_init-startup-warnings.patch
# Upstream fixes
Patch3: 5.83-fixes.patch
BuildRequires: dbus-devel >= 1.6
BuildRequires: glib2-devel
@ -239,6 +238,8 @@ install emulator/btvirt ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/
# https://github.com/bluez/bluez/issues/329#issuecomment-1102459104
%attr(0555, root, root) %dir %{_sysconfdir}/bluetooth
%config %{_sysconfdir}/bluetooth/main.conf
%config(noreplace) %{_sysconfdir}/bluetooth/input.conf
%config(noreplace) %{_sysconfdir}/bluetooth/network.conf
%{_bindir}/avinfo
%{_bindir}/bluemoon
%{_bindir}/bluetoothctl
@ -262,6 +263,7 @@ install emulator/btvirt ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/
%{_datadir}/dbus-1/system-services/org.bluez.service
%{_datadir}/dbus-1/system.d/bluetooth.conf
%{_unitdir}/bluetooth.service
%{_userunitdir}/mpris-proxy.service
%{_datadir}/zsh/site-functions/_bluetoothctl
%if %{with deprecated}
@ -298,6 +300,11 @@ install emulator/btvirt ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/
%{_mandir}/man1/isotest.1.*
%{_mandir}/man1/rctest.1.*
%{_mandir}/man5/org.bluez.*.5.*
%{_mandir}/man7/hci.7.*
%{_mandir}/man7/l2cap.7.*
%{_mandir}/man7/mgmt.7.*
%{_mandir}/man7/rfcomm.7.*
%{_mandir}/man7/sco.7.*
%{_libdir}/pkgconfig/bluez.pc
%dir %{_libexecdir}/bluetooth
%{_libexecdir}/bluetooth/btvirt
@ -326,9 +333,21 @@ install emulator/btvirt ${RPM_BUILD_ROOT}/%{_libexecdir}/bluetooth/
%files obexd
%{_libexecdir}/bluetooth/obexd
%{_datadir}/dbus-1/services/org.bluez.obex.service
/usr/lib/systemd/user/dbus-org.bluez.obex.service
%{_datadir}/dbus-1/system.d/obex.conf
%{_userunitdir}/obex.service
%changelog
* Mon Aug 18 2025 Bastien Nocera <bnocera@redhat.com> - 5.83-1
- Fix problem with menu handling
Resolves: RHEL-103966
* Fri Jun 13 2025 Bastien Nocera <bnocera@redhat.com> - 5.83-1
- Update to 5.83
Resolves: RHEL-94819
Resolves: RHEL-56073
Resolves: RHEL-1924
* Fri Jan 24 2025 Bastien Nocera <bnocera@redhat.com> - 5.72-4
- Fix plugin_init() startup warnings
Related: RHEL-68934