summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Müller <schnitzeltony@gmail.com>2018-03-22 18:40:52 +0100
committerJoe MacDonald <joe_macdonald@mentor.com>2018-04-25 15:53:45 -0400
commit575c14ded56e1e97582a6df0921d19b4da630961 (patch)
treebf07f4af9a0c316776926e5b0e7db28ef362ef06
parentf0a664f2b7ac42fa8832ecc016ddf8b6260ee50e (diff)
downloadmeta-openembedded-575c14ded56e1e97582a6df0921d19b4da630961.tar.gz
networkmanager: fix gobject-introspection/musl and cleanup
This adresses the comments for recent patch which updated nm to 1.10.6 and is a follow-up for [1]. * Make gobject-introspection work by skipping creation of gobject-introspection specific documentation. This fixes networkmanager-applet regression. * Cleanup patches: Remove current musl patches completely and re-use those found in void-linux because they do look much cleaner and don't touch glibc build. One nice side effect: In the future when nm is updated we can steal again and don't need to reenvent here. Usually they are much faster than we are (and I know one major contibutor personally from the good old Z80 times..) * Fix typo in PACKAGECONFIG [1] https://patchwork.openembedded.org/patch/149244/ Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch86
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch (renamed from meta-networking/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch)0
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch (renamed from meta-networking/recipes-connectivity/networkmanager/networkmanager/0007-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch)0
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch30
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch39
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Do-not-create-settings-settings-property-documentati.patch77
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch92
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/0006-check-for-strndupa-before-using-it.patch67
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-musl-basic.patch53
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-musl-dlopen-configure-ac.patch35
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-musl-network-support.patch72
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-musl-process-util.patch62
-rw-r--r--meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb33
13 files changed, 317 insertions, 329 deletions
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch
deleted file mode 100644
index 194e037227..0000000000
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch
+++ /dev/null
@@ -1,86 +0,0 @@
1From f81abf62c0ae93628df36c27357358523be25fb8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 31 Mar 2017 15:57:05 -0700
4Subject: [PATCH 1/7] adjust net/ headers for musl compatibility
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 libnm-core/nm-utils.c | 13 ++++++++-----
9 libnm-core/nm-utils.h | 5 ++---
10 src/platform/wifi/wifi-utils.h | 2 +-
11 3 files changed, 11 insertions(+), 9 deletions(-)
12
13diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
14index ebbbfd3..77273df 100644
15--- a/libnm-core/nm-utils.c
16+++ b/libnm-core/nm-utils.c
17@@ -19,14 +19,9 @@
18 * Copyright 2005 - 2017 Red Hat, Inc.
19 */
20
21-#include "nm-default.h"
22-
23-#include "nm-utils.h"
24-
25 #include <string.h>
26 #include <errno.h>
27 #include <stdlib.h>
28-#include <netinet/ether.h>
29 #include <arpa/inet.h>
30 #include <uuid/uuid.h>
31 #include <libintl.h>
32@@ -34,12 +29,20 @@
33 #include <sys/stat.h>
34 #include <net/if.h>
35 #include <linux/pkt_sched.h>
36+//#include <net/if_arp.h>
37+//#include <net/ethernet.h>
38+#include <netinet/ether.h>
39+
40+#include "nm-default.h"
41+
42+#include "nm-utils.h"
43
44 #if WITH_JANSSON
45 #include "nm-json.h"
46 #include <jansson.h>
47 #endif
48
49+
50 #include "nm-utils/nm-enum-utils.h"
51 #include "nm-utils/nm-hash-utils.h"
52 #include "nm-common-macros.h"
53diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
54index df9284b..02e24ea 100644
55--- a/libnm-core/nm-utils.h
56+++ b/libnm-core/nm-utils.h
57@@ -27,11 +27,10 @@
58
59 #include <glib.h>
60
61-#include <netinet/in.h>
62-
63 /* For ETH_ALEN and INFINIBAND_ALEN */
64-#include <linux/if_ether.h>
65+//#include <linux/if_ether.h>
66 #include <linux/if_infiniband.h>
67+#include <netinet/in.h>
68
69 #include "nm-core-enum-types.h"
70 #include "nm-setting-wireless-security.h"
71diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
72index 705717b..939080f 100644
73--- a/src/platform/wifi/wifi-utils.h
74+++ b/src/platform/wifi/wifi-utils.h
75@@ -22,7 +22,7 @@
76 #ifndef __WIFI_UTILS_H__
77 #define __WIFI_UTILS_H__
78
79-#include <net/ethernet.h>
80+//#include <net/ethernet.h>
81
82 #include "nm-dbus-interface.h"
83
84--
852.14.1
86
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
index 7194423192..7194423192 100644
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0007-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch
index 28848d3543..28848d3543 100644
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0007-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch
deleted file mode 100644
index cdcd397d73..0000000000
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 7f0e0613abe8aa1861946e2cc25397690da7128b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 31 Mar 2017 16:05:05 -0700
4Subject: [PATCH 2/7] socket-util.h: Include linux/sockios.h on musl
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 src/systemd/src/basic/socket-util.h | 6 ++++++
9 1 file changed, 6 insertions(+)
10
11diff --git a/src/systemd/src/basic/socket-util.h b/src/systemd/src/basic/socket-util.h
12index d7e2d85..2e7f7b6 100644
13--- a/src/systemd/src/basic/socket-util.h
14+++ b/src/systemd/src/basic/socket-util.h
15@@ -30,6 +30,12 @@
16 #include <linux/if_infiniband.h>
17 #include <linux/if_packet.h>
18
19+#if !defined(__GLIBC__)
20+/* SIOCGSTAMPNS from linux/asm-generic.h
21+ * for src/systemd/src/libsystemd-network/sd-lldp.c */
22+#include <linux/sockios.h>
23+#endif
24+
25 #include "macro.h"
26 #include "missing.h"
27 #include "util.h"
28--
292.14.1
30
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch
deleted file mode 100644
index 549e46e0e9..0000000000
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From d0951fe7da63d8296a305781d7322ce4d3249415 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 31 Mar 2017 16:08:45 -0700
4Subject: [PATCH 3/7] Define ETH_ALEN
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 libnm-core/nm-utils.h | 1 +
9 src/platform/wifi/wifi-utils.h | 2 ++
10 2 files changed, 3 insertions(+)
11
12diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
13index 02e24ea..5ff279c 100644
14--- a/libnm-core/nm-utils.h
15+++ b/libnm-core/nm-utils.h
16@@ -29,6 +29,7 @@
17
18 /* For ETH_ALEN and INFINIBAND_ALEN */
19 //#include <linux/if_ether.h>
20+#define ETH_ALEN 6 /* Octets in one ethernet addr */
21 #include <linux/if_infiniband.h>
22 #include <netinet/in.h>
23
24diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
25index 939080f..2274408 100644
26--- a/src/platform/wifi/wifi-utils.h
27+++ b/src/platform/wifi/wifi-utils.h
28@@ -24,6 +24,8 @@
29
30 //#include <net/ethernet.h>
31
32+#define ETH_ALEN 6 /* Octets in one ethernet addr */
33+
34 #include "nm-dbus-interface.h"
35
36 typedef struct WifiData WifiData;
37--
382.14.1
39
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Do-not-create-settings-settings-property-documentati.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Do-not-create-settings-settings-property-documentati.patch
new file mode 100644
index 0000000000..92485f0441
--- /dev/null
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Do-not-create-settings-settings-property-documentati.patch
@@ -0,0 +1,77 @@
1From 4f000a4a19975d6aba71427e693cd1ed080abda9 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Thu, 22 Mar 2018 11:08:30 +0100
4Subject: [PATCH] Do not create settings settings/property documentation
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9It was tried to get this work but gi / GirRepository could not be found by
10python. Anyway it is not necessary for us to have the settings/property docs.
11
12Upstream-Status: Inappropriate [OE specific]
13
14Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
15---
16 Makefile.am | 18 ++----------------
17 configure.ac | 4 ----
18 2 files changed, 2 insertions(+), 20 deletions(-)
19
20diff --git a/Makefile.am b/Makefile.am
21index 639921d..314a61d 100644
22--- a/Makefile.am
23+++ b/Makefile.am
24@@ -961,9 +961,7 @@ endif
25 if HAVE_INTROSPECTION
26
27 libnm_noinst_data = \
28- libnm/nm-property-docs.xml \
29 libnm/nm-settings-docs-overrides.xml \
30- libnm/nm-settings-docs.xml \
31 libnm/nm-settings-keyfile-docs.xml \
32 libnm/nm-settings-ifcfg-rh-docs.xml
33
34@@ -3317,23 +3315,11 @@ $(clients_common_libnmc_base_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
35 $(clients_common_libnmc_base_la_OBJECTS): clients/common/.dirstamp
36
37 clients_common_settings_doc_c = clients/common/settings-docs.c
38-if HAVE_INTROSPECTION
39-$(clients_common_settings_doc_c): clients/common/settings-docs.xsl libnm/nm-property-docs.xml clients/common/.dirstamp
40- $(AM_V_GEN) $(XSLTPROC) --output $@ $< $(word 2,$^)
41-DISTCLEANFILES += $(clients_common_settings_doc_c)
42-check-local-settings-docs: $(clients_common_settings_doc_c)
43- @if test -z "$$NMTST_NO_CHECK_SETTINGS_DOCS" ; then \
44- if ! cmp -s "$(srcdir)/$(clients_common_settings_doc_c).in" "$(builddir)/$(clients_common_settings_doc_c)" ; then \
45- echo "The generated file \"$(builddir)/$(clients_common_settings_doc_c)\" differs from the source file \"$(srcdir)/$(clients_common_settings_doc_c).in\". You probably should copy the generated file over to the source file. You can skip this test by setting \$$NMTST_NO_CHECK_SETTINGS_DOCS=yes"; \
46- false; \
47- fi;\
48- fi
49-check_local += check-local-settings-docs
50-else
51+
52 $(clients_common_settings_doc_c): $(clients_common_settings_doc_c).in clients/common/.dirstamp
53 $(AM_V_GEN) cp "$(srcdir)/$(clients_common_settings_doc_c).in" "$(builddir)/$(clients_common_settings_doc_c)"
54 check-local-settings-docs:
55-endif
56+
57 EXTRA_DIST += \
58 $(clients_common_settings_doc_c) \
59 $(clients_common_settings_doc_c).in
60diff --git a/configure.ac b/configure.ac
61index c9d3e56..407222e 100644
62--- a/configure.ac
63+++ b/configure.ac
64@@ -1286,10 +1286,6 @@ GTK_DOC_CHECK(1.0)
65 # check if we can build setting property documentation
66 build_docs=no
67 if test -n "$INTROSPECTION_MAKEFILE"; then
68- # If g-i is installed we know we have python, but we might not have pygobject
69- if ! "$PYTHON" -c 'from gi.repository import GObject' >& /dev/null; then
70- AC_MSG_ERROR(["--enable-introspection aims to build the settings documentation. This requires GObject introspection for python (pygobject)])
71- fi
72
73 AC_PATH_PROG(PERL, perl)
74 if test -z "$PERL"; then
75--
762.14.3
77
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch
deleted file mode 100644
index b56f6a37d8..0000000000
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch
+++ /dev/null
@@ -1,92 +0,0 @@
1From c9e0f112a90b6b1ade87a698608dca8d6fbe89cc Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 31 Mar 2017 16:09:41 -0700
4Subject: [PATCH 4/7] Define missing features to cater for musl
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 src/systemd/sd-adapt/nm-sd-adapt.h | 2 +-
9 src/systemd/src/basic/parse-util.c | 4 ++++
10 src/systemd/src/basic/stdio-util.h | 2 ++
11 src/systemd/src/basic/util.h | 5 +++++
12 src/systemd/src/systemd/sd-event.h | 4 ----
13 5 files changed, 12 insertions(+), 5 deletions(-)
14
15diff --git a/src/systemd/sd-adapt/nm-sd-adapt.h b/src/systemd/sd-adapt/nm-sd-adapt.h
16index 0d291e2..d88dd9b 100644
17--- a/src/systemd/sd-adapt/nm-sd-adapt.h
18+++ b/src/systemd/sd-adapt/nm-sd-adapt.h
19@@ -134,7 +134,7 @@ G_STMT_START { \
20 # ifdef HAVE___SECURE_GETENV
21 # define secure_getenv __secure_getenv
22 # else
23-# error neither secure_getenv nor __secure_getenv is available
24+# define secure_getenv getenv
25 # endif
26 #endif
27
28diff --git a/src/systemd/src/basic/parse-util.c b/src/systemd/src/basic/parse-util.c
29index 6d978e9..e74e84b 100644
30--- a/src/systemd/src/basic/parse-util.c
31+++ b/src/systemd/src/basic/parse-util.c
32@@ -21,7 +21,11 @@
33
34 #include <errno.h>
35 #include <inttypes.h>
36+#ifdef __GLIBC__
37+#include <xlocale.h>
38+#else
39 #include <locale.h>
40+#endif
41 #include <stdio.h>
42 #include <stdlib.h>
43 #include <string.h>
44diff --git a/src/systemd/src/basic/stdio-util.h b/src/systemd/src/basic/stdio-util.h
45index bd1144b..c92e935 100644
46--- a/src/systemd/src/basic/stdio-util.h
47+++ b/src/systemd/src/basic/stdio-util.h
48@@ -19,7 +19,9 @@
49 along with systemd; If not, see <http://www.gnu.org/licenses/>.
50 ***/
51
52+#ifdef __GLIBC__
53 #include <printf.h>
54+#endif
55 #include <stdarg.h>
56 #include <stdio.h>
57 #include <sys/types.h>
58diff --git a/src/systemd/src/basic/util.h b/src/systemd/src/basic/util.h
59index b31dfd1..9b7032c 100644
60--- a/src/systemd/src/basic/util.h
61+++ b/src/systemd/src/basic/util.h
62@@ -46,6 +46,11 @@
63 #include "missing.h"
64 #include "time-util.h"
65
66+#if !defined(__GLIBC__)
67+typedef int (*__compar_fn_t) (const void*, const void*);
68+typedef __compar_fn_t comparison_fn_t;
69+#endif
70+
71 size_t page_size(void) _pure_;
72 #define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
73
74diff --git a/src/systemd/src/systemd/sd-event.h b/src/systemd/src/systemd/sd-event.h
75index f8cb895..c7e0004 100644
76--- a/src/systemd/src/systemd/sd-event.h
77+++ b/src/systemd/src/systemd/sd-event.h
78@@ -69,11 +69,7 @@ typedef int (*sd_event_handler_t)(sd_event_source *s, void *userdata);
79 typedef int (*sd_event_io_handler_t)(sd_event_source *s, int fd, uint32_t revents, void *userdata);
80 typedef int (*sd_event_time_handler_t)(sd_event_source *s, uint64_t usec, void *userdata);
81 typedef int (*sd_event_signal_handler_t)(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata);
82-#if defined _GNU_SOURCE || _POSIX_C_SOURCE >= 199309L
83 typedef int (*sd_event_child_handler_t)(sd_event_source *s, const siginfo_t *si, void *userdata);
84-#else
85-typedef void* sd_event_child_handler_t;
86-#endif
87
88 int sd_event_default(sd_event **e);
89
90--
912.14.1
92
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0006-check-for-strndupa-before-using-it.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/0006-check-for-strndupa-before-using-it.patch
deleted file mode 100644
index 6adb84baa8..0000000000
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager/0006-check-for-strndupa-before-using-it.patch
+++ /dev/null
@@ -1,67 +0,0 @@
1From f24d958fc85f9a43ac13abc85f74c4ae233dc8a4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 31 Mar 2017 18:37:19 -0700
4Subject: [PATCH 6/7] check for strndupa before using it
5
6musl does not have strndupa
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 config.h.in | 4 ++++
11 configure.ac | 1 +
12 src/systemd/src/basic/alloc-util.h | 12 ++++++++++++
13 3 files changed, 17 insertions(+)
14
15diff --git a/config.h.in b/config.h.in
16index edec211..0799030 100644
17--- a/config.h.in
18+++ b/config.h.in
19@@ -34,6 +34,10 @@
20 */
21 #undef HAVE_DCGETTEXT
22
23+/* Define to 1 if you have the declaration of `strndupa', and to 0 if you
24+ don't. */
25+#undef HAVE_DECL_STRNDUPA
26+
27 /* Define to 1 if you have the declaration of `explicit_bzero', and to 0 if
28 you don't. */
29 #undef HAVE_DECL_EXPLICIT_BZERO
30diff --git a/configure.ac b/configure.ac
31index 8a066ad..51e5eb6 100644
32--- a/configure.ac
33+++ b/configure.ac
34@@ -56,6 +56,7 @@ AC_SUBST(NM_VERSION)
35
36 GIT_SHA_RECORD(NM_GIT_SHA)
37
38+AC_CHECK_DECLS([strndupa], [], [], [[#include <string.h>]])
39 dnl
40 dnl Checks for typedefs, structures, and compiler characteristics.
41 dnl
42diff --git a/src/systemd/src/basic/alloc-util.h b/src/systemd/src/basic/alloc-util.h
43index 0a89691..1e95260 100644
44--- a/src/systemd/src/basic/alloc-util.h
45+++ b/src/systemd/src/basic/alloc-util.h
46@@ -25,6 +25,18 @@
47 #include <string.h>
48
49 #include "macro.h"
50+#include "config.h"
51+
52+#if !HAVE_DECL_STRNDUPA
53+#define strndupa(s, n) \
54+ ({ \
55+ const char *__old = (s); \
56+ size_t __len = strnlen(__old, (n)); \
57+ char *__new = (char *)alloca(__len + 1); \
58+ __new[__len] = '\0'; \
59+ (char *)memcpy(__new, __old, __len); \
60+ })
61+#endif
62
63 #define new(t, n) ((t*) malloc_multiply(sizeof(t), (n)))
64
65--
662.14.1
67
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-musl-basic.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-musl-basic.patch
new file mode 100644
index 0000000000..9d208e1fda
--- /dev/null
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-musl-basic.patch
@@ -0,0 +1,53 @@
1From e92de7409a3e107f90d108a9c5d49bd0418296dd Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Thu, 22 Mar 2018 17:54:10 +0100
4Subject: [PATCH 1/4] Usual fix for musl libc
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Upstream-Status: Pending
10
11Stolen from [1] and prettyfied slightly
12
13[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
14
15Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
16---
17 src/systemd/src/basic/stdio-util.h | 2 ++
18 src/systemd/src/basic/util.h | 5 +++++
19 2 files changed, 7 insertions(+)
20
21diff --git a/src/systemd/src/basic/stdio-util.h b/src/systemd/src/basic/stdio-util.h
22index bd1144b..9eafacb 100644
23--- a/src/systemd/src/basic/stdio-util.h
24+++ b/src/systemd/src/basic/stdio-util.h
25@@ -19,7 +19,9 @@
26 along with systemd; If not, see <http://www.gnu.org/licenses/>.
27 ***/
28
29+#if defined(__GLIBC__)
30 #include <printf.h>
31+#endif
32 #include <stdarg.h>
33 #include <stdio.h>
34 #include <sys/types.h>
35diff --git a/src/systemd/src/basic/util.h b/src/systemd/src/basic/util.h
36index b31dfd1..9b7032c 100644
37--- a/src/systemd/src/basic/util.h
38+++ b/src/systemd/src/basic/util.h
39@@ -46,6 +46,11 @@
40 #include "missing.h"
41 #include "time-util.h"
42
43+#if !defined(__GLIBC__)
44+typedef int (*__compar_fn_t) (const void*, const void*);
45+typedef __compar_fn_t comparison_fn_t;
46+#endif
47+
48 size_t page_size(void) _pure_;
49 #define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
50
51--
522.14.3
53
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-musl-dlopen-configure-ac.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-musl-dlopen-configure-ac.patch
new file mode 100644
index 0000000000..548cccb329
--- /dev/null
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-musl-dlopen-configure-ac.patch
@@ -0,0 +1,35 @@
1From 57239fda56b68a8f3e413f7b6af5290ba0d86636 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Thu, 22 Mar 2018 18:18:06 +0100
4Subject: [PATCH 2/4] musl: dlopen is included so LD_LIBS="" instead of
5 LD_LIBS="none required"
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10Upstream-Status: Pending
11
12Stolen from [1] and prettyfied slightly
13
14[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
15
16Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
17---
18 configure.ac | 1 +
19 1 file changed, 1 insertion(+)
20
21diff --git a/configure.ac b/configure.ac
22index 487a266..96ae4f7 100644
23--- a/configure.ac
24+++ b/configure.ac
25@@ -305,6 +305,7 @@ dnl
26 dnl Checks for libdl - on certain platforms its part of libc
27 dnl
28 AC_SEARCH_LIBS([dlopen], [dl dld], [], [ac_cv_search_dlopen=])
29+AS_IF([test "$ac_cv_search_dlopen" = "none required"],[ac_cv_search_dlopen=""])
30 AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen")
31
32 PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0],
33--
342.14.3
35
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-musl-network-support.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-musl-network-support.patch
new file mode 100644
index 0000000000..5dd17b63b4
--- /dev/null
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-musl-network-support.patch
@@ -0,0 +1,72 @@
1From 714b4731a238653e9c7d885c0dee10677b0a4df3 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Thu, 22 Mar 2018 18:24:07 +0100
4Subject: [PATCH 3/4] musl: network support
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Upstream-Status: Pending
10
11Stolen from [1] and prettyfied slightly
12
13[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
14
15Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
16---
17 libnm-core/nm-utils.h | 4 ++++
18 src/platform/wifi/wifi-utils.h | 4 ++++
19 src/systemd/src/basic/socket-util.h | 5 +++++
20 3 files changed, 13 insertions(+)
21
22diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
23index df9284b..2bcf4b8 100644
24--- a/libnm-core/nm-utils.h
25+++ b/libnm-core/nm-utils.h
26@@ -30,7 +30,11 @@
27 #include <netinet/in.h>
28
29 /* For ETH_ALEN and INFINIBAND_ALEN */
30+#if defined(__GLIBC__)
31 #include <linux/if_ether.h>
32+#else
33+#define ETH_ALEN 6 /* Octets in one ethernet addr */
34+#endif
35 #include <linux/if_infiniband.h>
36
37 #include "nm-core-enum-types.h"
38diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
39index 705717b..da3edc4 100644
40--- a/src/platform/wifi/wifi-utils.h
41+++ b/src/platform/wifi/wifi-utils.h
42@@ -22,7 +22,11 @@
43 #ifndef __WIFI_UTILS_H__
44 #define __WIFI_UTILS_H__
45
46+#if defined(__GLIBC__)
47 #include <net/ethernet.h>
48+#else /* musl libc */
49+#define ETH_ALEN 6 /* Octets in one ethernet addr */
50+#endif
51
52 #include "nm-dbus-interface.h"
53
54diff --git a/src/systemd/src/basic/socket-util.h b/src/systemd/src/basic/socket-util.h
55index d7e2d85..d109c84 100644
56--- a/src/systemd/src/basic/socket-util.h
57+++ b/src/systemd/src/basic/socket-util.h
58@@ -29,6 +29,11 @@
59 #include <linux/netlink.h>
60 #include <linux/if_infiniband.h>
61 #include <linux/if_packet.h>
62+#if !defined(__GLIBC__)
63+/* SIOCGSTAMPNS from linux/asm-generic.h
64+ * for src/systemd/src/libsystemd-network/sd-lldp.c */
65+#include <linux/sockios.h>
66+#endif
67
68 #include "macro.h"
69 #include "missing.h"
70--
712.14.3
72
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-musl-process-util.patch b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-musl-process-util.patch
new file mode 100644
index 0000000000..fc55ce85f6
--- /dev/null
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-musl-process-util.patch
@@ -0,0 +1,62 @@
1From d513c8bfc982dbd976617178b040c512c95710b6 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Thu, 22 Mar 2018 18:29:00 +0100
4Subject: [PATCH 4/4] musl: process-util
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Upstream-Status: Pending
10
11Stolen from [1] and prettyfied slightly
12
13[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
14
15Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
16---
17 src/systemd/src/basic/process-util.c | 9 +++++++++
18 1 file changed, 9 insertions(+)
19
20diff --git a/src/systemd/src/basic/process-util.c b/src/systemd/src/basic/process-util.c
21index 272030d..485f1db 100644
22--- a/src/systemd/src/basic/process-util.c
23+++ b/src/systemd/src/basic/process-util.c
24@@ -36,6 +36,9 @@
25 #include <sys/wait.h>
26 #include <syslog.h>
27 #include <unistd.h>
28+#ifndef __GLIBC__
29+#include <pthread.h>
30+#endif
31 #if 0 /* NM_IGNORED */
32 #if HAVE_VALGRIND_VALGRIND_H
33 #include <valgrind/valgrind.h>
34@@ -1015,11 +1018,13 @@ static void reset_cached_pid(void) {
35 cached_pid = CACHED_PID_UNSET;
36 }
37
38+#ifdef __GLIBC__
39 /* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc
40 * headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
41 * libpthread, as it is part of glibc anyway. */
42 extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void * __dso_handle);
43 extern void* __dso_handle __attribute__ ((__weak__));
44+#endif
45
46 pid_t getpid_cached(void) {
47 pid_t current_value;
48@@ -1042,7 +1047,11 @@ pid_t getpid_cached(void) {
49
50 new_pid = getpid();
51
52+#ifdef __GLIBC__
53 if (__register_atfork(NULL, NULL, reset_cached_pid, __dso_handle) != 0) {
54+#else
55+ if (pthread_atfork(NULL, NULL, reset_cached_pid) != 0) {
56+#endif
57 /* OOM? Let's try again later */
58 cached_pid = CACHED_PID_UNSET;
59 return new_pid;
60--
612.14.3
62
diff --git a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb
index 6538e7b823..f201a75a0a 100644
--- a/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb
+++ b/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=cbbffd568227ada506640fe950a4823b \
10 10
11DEPENDS = " \ 11DEPENDS = " \
12 intltool-native \ 12 intltool-native \
13 libxslt-native \
13 libnl \ 14 libnl \
14 dbus \ 15 dbus \
15 dbus-glib \ 16 dbus-glib \
@@ -23,18 +24,18 @@ DEPENDS = " \
23 curl \ 24 curl \
24" 25"
25 26
26inherit gnomebase gettext systemd bluetooth bash-completion vala gobject-introspection 27inherit gnomebase gettext systemd bluetooth bash-completion vala gobject-introspection gtk-doc
27 28
28GI_DATA_ENABLED_libc-musl = "False" 29SRC_URI = " \
29 30 ${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
30SRC_URI = "${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \ 31 file://0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch \
31 file://0001-adjust-net-headers-for-musl-compatibility.patch \ 32 file://0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch \
32 file://0002-socket-util.h-Include-linux-sockios.h-on-musl.patch \ 33 file://0003-Do-not-create-settings-settings-property-documentati.patch \
33 file://0003-Define-ETH_ALEN.patch \ 34 file://musl/0001-musl-basic.patch \
34 file://0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch \ 35 file://musl/0002-musl-dlopen-configure-ac.patch \
35 file://0006-check-for-strndupa-before-using-it.patch \ 36 file://musl/0003-musl-network-support.patch \
36 file://0007-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch \ 37 file://musl/0004-musl-process-util.patch \
37 " 38"
38SRC_URI[md5sum] = "de3c7147a693da6f80eb22f126086a14" 39SRC_URI[md5sum] = "de3c7147a693da6f80eb22f126086a14"
39SRC_URI[sha256sum] = "6af0b1e856a3725f88791f55c4fbb04105dc0b20dbf182aaec8aad16481fac76" 40SRC_URI[sha256sum] = "6af0b1e856a3725f88791f55c4fbb04105dc0b20dbf182aaec8aad16481fac76"
40 41
@@ -44,20 +45,22 @@ EXTRA_OECONF = " \
44 --disable-ifcfg-rh \ 45 --disable-ifcfg-rh \
45 --disable-ifnet \ 46 --disable-ifnet \
46 --disable-ifcfg-suse \ 47 --disable-ifcfg-suse \
47 --disable-introspection \
48 --disable-more-warnings \ 48 --disable-more-warnings \
49 --with-iptables=${sbindir}/iptables \ 49 --with-iptables=${sbindir}/iptables \
50 --with-tests \ 50 --with-tests \
51 --with-nmtui=yes \ 51 --with-nmtui=yes \
52" 52"
53 53
54# gobject-introspection related
55GI_DATA_ENABLED_libc-musl = "False"
56
54do_compile_prepend() { 57do_compile_prepend() {
55 export GIR_EXTRA_LIBS_PATH="${B}/libnm-util/.libs" 58 export GIR_EXTRA_LIBS_PATH="${B}/libnm/.libs:${B}/libnm-glib/.libs:${B}/libnm-util/.libs"
56} 59}
57 60
58PACKAGECONFIG ??= "nss ifupdown netconfig dhclient dnsmasq \ 61PACKAGECONFIG ??= "nss ifupdown netconfig dhclient dnsmasq \
59 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', \ 62 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', \
60 bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \ 63 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \
61 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \ 64 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
62 ${@bb.utils.filter('DISTRO_FEATURES', 'wifi', d)} \ 65 ${@bb.utils.filter('DISTRO_FEATURES', 'wifi', d)} \
63" 66"