summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5.inc3
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/0001-Provide-GNU-basename-compatible-implementation.patch147
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/0001-gdbus-define-MAX_INPUT-for-musl.patch34
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/0001-mesh-Move-local-basename-into-utility-file.patch114
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/0001-test-gatt-Fix-hung-issue.patch2
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch2
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5_5.79.bb (renamed from meta/recipes-connectivity/bluez5/bluez5_5.78.bb)2
7 files changed, 38 insertions, 266 deletions
diff --git a/meta/recipes-connectivity/bluez5/bluez5.inc b/meta/recipes-connectivity/bluez5/bluez5.inc
index b3bcd278e6..d31f4e2295 100644
--- a/meta/recipes-connectivity/bluez5/bluez5.inc
+++ b/meta/recipes-connectivity/bluez5/bluez5.inc
@@ -69,8 +69,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
69 file://run-ptest \ 69 file://run-ptest \
70 file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \ 70 file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
71 file://0001-test-gatt-Fix-hung-issue.patch \ 71 file://0001-test-gatt-Fix-hung-issue.patch \
72 file://0001-Provide-GNU-basename-compatible-implementation.patch \ 72 file://0001-gdbus-define-MAX_INPUT-for-musl.patch \
73 file://0001-mesh-Move-local-basename-into-utility-file.patch \
74 " 73 "
75S = "${WORKDIR}/bluez-${PV}" 74S = "${WORKDIR}/bluez-${PV}"
76 75
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-Provide-GNU-basename-compatible-implementation.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-Provide-GNU-basename-compatible-implementation.patch
deleted file mode 100644
index 4f028e589b..0000000000
--- a/meta/recipes-connectivity/bluez5/bluez5/0001-Provide-GNU-basename-compatible-implementation.patch
+++ /dev/null
@@ -1,147 +0,0 @@
1From 44e24350aae771daa93e5a85378856f91358688f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 26 Aug 2024 09:55:03 -0700
4Subject: [PATCH] Provide GNU basename compatible implementation
5
6Call to basename() relies on a GNU extension
7to take a const char * vs a char *. Let's define
8a trivial helper function to ensure compatibility
9with musl.
10
11Fixes Issue: https://github.com/bluez/bluez/issues/843
12
13Upstream-Status: Submitted [https://lore.kernel.org/linux-bluetooth/20240826173844.2918630-1-raj.khem@gmail.com/T/#u]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 configure.ac | 11 ++++++++++-
17 mesh/mesh-config-json.c | 4 +++-
18 mesh/missing.h | 21 +++++++++++++++++++++
19 mesh/rpl.c | 1 +
20 tools/hex2hcd.c | 1 +
21 tools/missing.h | 21 +++++++++++++++++++++
22 6 files changed, 57 insertions(+), 2 deletions(-)
23 create mode 100644 mesh/missing.h
24 create mode 100644 tools/missing.h
25
26diff --git a/configure.ac b/configure.ac
27index a7fb51f..254f1a7 100644
28--- a/configure.ac
29+++ b/configure.ac
30@@ -70,7 +70,16 @@ AC_CHECK_LIB(pthread, pthread_create, dummy=yes,
31 AC_CHECK_LIB(dl, dlopen, dummy=yes,
32 AC_MSG_ERROR(dynamic linking loader is required))
33
34-AC_CHECK_HEADERS(linux/types.h linux/if_alg.h linux/uinput.h linux/uhid.h sys/random.h)
35+AC_CHECK_HEADERS(string.h linux/types.h linux/if_alg.h linux/uinput.h linux/uhid.h sys/random.h)
36+
37+# basename may be only available in libgen.h with the POSIX behavior,
38+# not desired here
39+AC_CHECK_DECLS([basename], [],
40+ AC_MSG_WARN([GNU basename extension not found]),
41+ [#define _GNU_SOURCE 1
42+ #include <string.h>
43+ ])
44+
45
46 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28)
47
48diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
49index c198627..e3b0a18 100644
50--- a/mesh/mesh-config-json.c
51+++ b/mesh/mesh-config-json.c
52@@ -28,6 +28,7 @@
53 #include <ell/ell.h>
54 #include <json-c/json.h>
55
56+#include "mesh/missing.h"
57 #include "mesh/mesh-defs.h"
58 #include "mesh/util.h"
59 #include "mesh/mesh-config.h"
60@@ -2694,7 +2695,8 @@ bool mesh_config_load_nodes(const char *cfgdir_name, mesh_config_node_func_t cb,
61
62 void mesh_config_destroy_nvm(struct mesh_config *cfg)
63 {
64- char *node_dir, *node_name;
65+ char *node_dir;
66+ const char* node_name;
67 char uuid[33];
68
69 if (!cfg)
70diff --git a/mesh/missing.h b/mesh/missing.h
71new file mode 100644
72index 0000000..eaf3281
73--- /dev/null
74+++ b/mesh/missing.h
75@@ -0,0 +1,21 @@
76+// SPDX-License-Identifier: LGPL-2.1-or-later
77+/*
78+ *
79+ * BlueZ - Bluetooth protocol stack for Linux
80+ *
81+ * Copyright (C) 2024 Khem Raj <raj.khem@gmail.com>
82+ *
83+ */
84+
85+#ifdef HAVE_CONFIG_H
86+#include <config.h>
87+#endif
88+#if !HAVE_DECL_BASENAME
89+#include <string.h>
90+static inline const char *basename(const char *path)
91+{
92+ const char *base = strrchr(path, '/');
93+
94+ return base ? base + 1 : path;
95+}
96+#endif
97diff --git a/mesh/rpl.c b/mesh/rpl.c
98index fb225dd..2fa17d7 100644
99--- a/mesh/rpl.c
100+++ b/mesh/rpl.c
101@@ -24,6 +24,7 @@
102
103 #include <ell/ell.h>
104
105+#include "mesh/missing.h"
106 #include "mesh/mesh-defs.h"
107
108 #include "mesh/node.h"
109diff --git a/tools/hex2hcd.c b/tools/hex2hcd.c
110index e6dca5a..452ab2b 100644
111--- a/tools/hex2hcd.c
112+++ b/tools/hex2hcd.c
113@@ -24,6 +24,7 @@
114 #include <stdlib.h>
115 #include <stdbool.h>
116 #include <sys/stat.h>
117+#include "tools/missing.h"
118
119 static ssize_t process_record(int fd, const char *line, uint16_t *upper_addr)
120 {
121diff --git a/tools/missing.h b/tools/missing.h
122new file mode 100644
123index 0000000..eaf3281
124--- /dev/null
125+++ b/tools/missing.h
126@@ -0,0 +1,21 @@
127+// SPDX-License-Identifier: LGPL-2.1-or-later
128+/*
129+ *
130+ * BlueZ - Bluetooth protocol stack for Linux
131+ *
132+ * Copyright (C) 2024 Khem Raj <raj.khem@gmail.com>
133+ *
134+ */
135+
136+#ifdef HAVE_CONFIG_H
137+#include <config.h>
138+#endif
139+#if !HAVE_DECL_BASENAME
140+#include <string.h>
141+static inline const char *basename(const char *path)
142+{
143+ const char *base = strrchr(path, '/');
144+
145+ return base ? base + 1 : path;
146+}
147+#endif
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-gdbus-define-MAX_INPUT-for-musl.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-gdbus-define-MAX_INPUT-for-musl.patch
new file mode 100644
index 0000000000..de01dc864e
--- /dev/null
+++ b/meta/recipes-connectivity/bluez5/bluez5/0001-gdbus-define-MAX_INPUT-for-musl.patch
@@ -0,0 +1,34 @@
1From 6f40d44acbfb0021f21bd63e6c0703ba701d19c4 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= <gudni.m.g@gmail.com>
3Date: Sat, 2 Nov 2024 16:03:34 +0000
4Subject: [PATCH] gdbus: define MAX_INPUT for musl
5
6This is the same solution as was done in src/shared/util.c
7
8Upstream-Status: Submitted [https://marc.info/?l=linux-bluetooth&m=173056368428988&w=2]
9
10Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com.com>
11---
12 gdbus/object.c | 6 ++++++
13 1 file changed, 6 insertions(+)
14
15diff --git a/gdbus/object.c b/gdbus/object.c
16index 84f116bf1..7b0476f1a 100644
17--- a/gdbus/object.c
18+++ b/gdbus/object.c
19@@ -20,6 +20,12 @@
20 #include <dbus/dbus.h>
21
22 #include "gdbus.h"
23+
24+/* define MAX_INPUT for musl */
25+#ifndef MAX_INPUT
26+#define MAX_INPUT _POSIX_MAX_INPUT
27+#endif
28+
29 #include "src/shared/util.h"
30
31 #define info(fmt...)
32--
332.43.0
34
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-mesh-Move-local-basename-into-utility-file.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-mesh-Move-local-basename-into-utility-file.patch
deleted file mode 100644
index 33c12fc3a8..0000000000
--- a/meta/recipes-connectivity/bluez5/bluez5/0001-mesh-Move-local-basename-into-utility-file.patch
+++ /dev/null
@@ -1,114 +0,0 @@
1From e64c2e70a74da452b0ee147350c4ce93e1db8d2f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 16 Sep 2024 15:11:01 -0700
4Subject: [PATCH v2] mesh: Move local basename into utility file
5
6Defining an override via a missing.h can prove difficult when a file
7needs to use basename and dirname both the APIs and needs to include
8libgen.h for them, in such situations there will be signature clash
9for basename function.
10
11Upstream-Status: Submitted [https://lore.kernel.org/linux-bluetooth/20240917031745.1641153-1-raj.khem@gmail.com/T/#u]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13
14---
15v2: Remove reference to missing.h in Makefile.mesh
16
17 Makefile.mesh | 2 +-
18 mesh/mesh-config-json.c | 3 +--
19 mesh/missing.h | 21 ---------------------
20 mesh/rpl.c | 3 +--
21 mesh/util.c | 10 ++++++++++
22 mesh/util.h | 5 +++++
23 6 files changed, 18 insertions(+), 26 deletions(-)
24 delete mode 100644 mesh/missing.h
25
26--- a/mesh/mesh-config-json.c
27+++ b/mesh/mesh-config-json.c
28@@ -28,7 +28,6 @@
29 #include <ell/ell.h>
30 #include <json-c/json.h>
31
32-#include "mesh/missing.h"
33 #include "mesh/mesh-defs.h"
34 #include "mesh/util.h"
35 #include "mesh/mesh-config.h"
36@@ -2708,7 +2707,7 @@ void mesh_config_destroy_nvm(struct mesh
37 if (!hex2str(cfg->uuid, 16, uuid, sizeof(uuid)))
38 return;
39
40- node_name = basename(node_dir);
41+ node_name = mesh_basename(node_dir);
42
43 /* Make sure path name of node follows expected guidelines */
44 if (strcmp(node_name, uuid))
45--- a/mesh/missing.h
46+++ /dev/null
47@@ -1,21 +0,0 @@
48-// SPDX-License-Identifier: LGPL-2.1-or-later
49-/*
50- *
51- * BlueZ - Bluetooth protocol stack for Linux
52- *
53- * Copyright (C) 2024 Khem Raj <raj.khem@gmail.com>
54- *
55- */
56-
57-#ifdef HAVE_CONFIG_H
58-#include <config.h>
59-#endif
60-#if !HAVE_DECL_BASENAME
61-#include <string.h>
62-static inline const char *basename(const char *path)
63-{
64- const char *base = strrchr(path, '/');
65-
66- return base ? base + 1 : path;
67-}
68-#endif
69--- a/mesh/rpl.c
70+++ b/mesh/rpl.c
71@@ -24,7 +24,6 @@
72
73 #include <ell/ell.h>
74
75-#include "mesh/missing.h"
76 #include "mesh/mesh-defs.h"
77
78 #include "mesh/node.h"
79@@ -147,7 +146,7 @@ static void get_entries(const char *iv_p
80 if (!dir)
81 return;
82
83- iv_txt = basename(iv_path);
84+ iv_txt = mesh_basename(iv_path);
85 if (sscanf(iv_txt, "%08x", &iv_index) != 1) {
86 closedir(dir);
87 return;
88--- a/mesh/util.c
89+++ b/mesh/util.c
90@@ -161,3 +161,13 @@ void enable_debug(void)
91 debug_enabled = true;
92 l_debug_enable("*");
93 }
94+
95+#if !HAVE_DECL_BASENAME
96+#include <string.h>
97+const char *mesh_basename(const char *path)
98+{
99+ const char *base = strrchr(path, '/');
100+
101+ return base ? base + 1 : path;
102+}
103+#endif
104--- a/mesh/util.h
105+++ b/mesh/util.h
106@@ -16,3 +16,8 @@ void print_packet(const char *label, con
107 int create_dir(const char *dir_name);
108 void del_path(const char *path);
109 void enable_debug(void);
110+#if !HAVE_DECL_BASENAME
111+const char *mesh_basename(const char *path);
112+#else
113+#define mesh_basename basename
114+#endif
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-test-gatt-Fix-hung-issue.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-test-gatt-Fix-hung-issue.patch
index 1b1af4ba96..572f5b0be3 100644
--- a/meta/recipes-connectivity/bluez5/bluez5/0001-test-gatt-Fix-hung-issue.patch
+++ b/meta/recipes-connectivity/bluez5/bluez5/0001-test-gatt-Fix-hung-issue.patch
@@ -1,4 +1,4 @@
1From b8371d1111e21a9b3285ec0864b78e98d7acf79f Mon Sep 17 00:00:00 2001 1From 825e15ddda4aa6d8e37c1c52181f7175d2237f66 Mon Sep 17 00:00:00 2001
2From: Mingli Yu <Mingli.Yu@windriver.com> 2From: Mingli Yu <Mingli.Yu@windriver.com>
3Date: Fri, 24 Aug 2018 12:04:03 +0800 3Date: Fri, 24 Aug 2018 12:04:03 +0800
4Subject: [PATCH] test-gatt: Fix hung issue 4Subject: [PATCH] test-gatt: Fix hung issue
diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
index b85c050ffc..f56142ee50 100644
--- a/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
+++ b/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
@@ -1,4 +1,4 @@
1From bbfecd4407b6425f409c4657ac96e67f0a995a12 Mon Sep 17 00:00:00 2001 1From 9ce6360d11f0b1252f61ff78ce6f8ef03b150dfd Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 1 Apr 2016 17:07:34 +0300 3Date: Fri, 1 Apr 2016 17:07:34 +0300
4Subject: [PATCH] tests: add a target for building tests without running them 4Subject: [PATCH] tests: add a target for building tests without running them
diff --git a/meta/recipes-connectivity/bluez5/bluez5_5.78.bb b/meta/recipes-connectivity/bluez5/bluez5_5.79.bb
index 23d1ad69d8..30ea6d317b 100644
--- a/meta/recipes-connectivity/bluez5/bluez5_5.78.bb
+++ b/meta/recipes-connectivity/bluez5/bluez5_5.79.bb
@@ -1,6 +1,6 @@
1require bluez5.inc 1require bluez5.inc
2 2
3SRC_URI[sha256sum] = "830fed1915c5d375b8de0f5e6f45fcdea0dcc5ff5ffb3d31db6ed0f00d73c5e3" 3SRC_URI[sha256sum] = "4164a5303a9f71c70f48c03ff60be34231b568d93a9ad5e79928d34e6aa0ea8a"
4 4
5CVE_STATUS[CVE-2020-24490] = "cpe-incorrect: This issue has kernel fixes rather than bluez fixes" 5CVE_STATUS[CVE-2020-24490] = "cpe-incorrect: This issue has kernel fixes rather than bluez fixes"
6 6