diff mbox series

[meta-networking] crda: remove recipe

Message ID 20230119083744.33977-1-kai.kang@windriver.com
State New
Headers show
Series [meta-networking] crda: remove recipe | expand

Commit Message

Kai Jan. 19, 2023, 8:37 a.m. UTC
From: Kai Kang <kai.kang@windriver.com>

CRDA is no longer needed as of kernel v4.15 since commit 007f6c5e6eb45
("cfg80211: support loading regulatory database as firmware file") added
support to use the kernel's firmware request API which looks for the
firmware on /lib/firmware. Because of this CRDA is legacy software for
older kernels, remove the recipe.

It could change regulatory domains with iw and wpa_supplicant.

Refs
1. https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git/tree/README#n8
2. https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 ...-Make-alpha2-to-be-3-characters-long.patch |  31 ------
 ...-Makefile-respect-LDFLAGS-for-libreg.patch |  29 -----
 .../0001-reglib-Remove-unused-variables.patch |  59 ----------
 .../crda/crda/crda-4.14-python-3.patch        | 101 ------------------
 ...o-not-run-ldconfig-if-destdir-is-set.patch |  21 ----
 .../crda/fix-gcc-6-unused-variables.patch     |  11 --
 .../crda/fix-issues-when-USE_OPENSSL-1.patch  |  58 ----------
 ...-linking-of-libraries-used-by-reglib.patch |  57 ----------
 .../recipes-connectivity/crda/crda/make.patch |  25 -----
 ...e-target-word-size-instead-of-host-s.patch |  34 ------
 .../recipes-connectivity/crda/crda_3.18.bb    |  40 -------
 11 files changed, 466 deletions(-)
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
 delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb

Comments

Randy MacLeod Jan. 19, 2023, 11:34 a.m. UTC | #1
Add Theo, who changed crda earlier this year:

   https://lists.openembedded.org/g/openembedded-devel/message/97671

Does anyone really still need crda?

../Randy

On 2023-01-19 03:37, kai.kang@windriver.com wrote:
> From: Kai Kang <kai.kang@windriver.com>
> 
> CRDA is no longer needed as of kernel v4.15 since commit 007f6c5e6eb45
> ("cfg80211: support loading regulatory database as firmware file") added
> support to use the kernel's firmware request API which looks for the
> firmware on /lib/firmware. Because of this CRDA is legacy software for
> older kernels, remove the recipe.
> 
> It could change regulatory domains with iw and wpa_supplicant.
> 
> Refs
> 1. https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git/tree/README#n8
> 2. https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA
> 
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>   ...-Make-alpha2-to-be-3-characters-long.patch |  31 ------
>   ...-Makefile-respect-LDFLAGS-for-libreg.patch |  29 -----
>   .../0001-reglib-Remove-unused-variables.patch |  59 ----------
>   .../crda/crda/crda-4.14-python-3.patch        | 101 ------------------
>   ...o-not-run-ldconfig-if-destdir-is-set.patch |  21 ----
>   .../crda/fix-gcc-6-unused-variables.patch     |  11 --
>   .../crda/fix-issues-when-USE_OPENSSL-1.patch  |  58 ----------
>   ...-linking-of-libraries-used-by-reglib.patch |  57 ----------
>   .../recipes-connectivity/crda/crda/make.patch |  25 -----
>   ...e-target-word-size-instead-of-host-s.patch |  34 ------
>   .../recipes-connectivity/crda/crda_3.18.bb    |  40 -------
>   11 files changed, 466 deletions(-)
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
>   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
> 
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
> deleted file mode 100644
> index f1d2cbc5a..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -From 078e962d345fd0536fe7ba797485ee1a4159c032 Mon Sep 17 00:00:00 2001
> -From: Khem Raj <raj.khem@gmail.com>
> -Date: Fri, 4 Feb 2022 09:18:30 -0800
> -Subject: [PATCH] Make alpha2 to be 3 characters long
> -
> -Fixes buffer overflow
> -reglib.c:969:9: error: 'sscanf' may overflow; destination buffer in argument 3 has size 2, but the corresponding specifier may require size 3 [-Werror,-Wfortify-source]
> -                      alpha2,
> -                      ^
> -Upstream-Status: Pending
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ----
> - reglib.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/reglib.c b/reglib.c
> -index e00e9b8..8565a0b 100644
> ---- a/reglib.c
> -+++ b/reglib.c
> -@@ -958,7 +958,7 @@ reglib_parse_rules(FILE *fp, struct ieee80211_regdomain *trd)
> - static int reglib_parse_country_dfs(char *line, struct ieee80211_regdomain *rd)
> - {
> - 	char dfs_region_alpha[9];
> --	char alpha2[2];
> -+	char alpha2[3];
> - 	int hits;
> -
> - 	memset(rd, 0, sizeof(*rd));
> ---
> -2.35.1
> -
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
> deleted file mode 100644
> index 16800d506..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -From 1e1a78b7b4fa1662b4447aa19c15b1e839b7e9db Mon Sep 17 00:00:00 2001
> -From: =?UTF-8?q?Stefan=20M=C3=BCller-Klieser?= <s.mueller-klieser@phytec.de>
> -Date: Wed, 24 Aug 2016 10:58:45 +0200
> -Subject: [PATCH] Makefile: respect LDFLAGS for libreg
> -MIME-Version: 1.0
> -Content-Type: text/plain; charset=UTF-8
> -Content-Transfer-Encoding: 8bit
> -
> -Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
> ----
> - Makefile | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/Makefile b/Makefile
> -index 2879896..1650db8 100644
> ---- a/Makefile
> -+++ b/Makefile
> -@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
> -
> - $(LIBREG): regdb.h reglib.h reglib.c
> - 	$(NQ) '  CC  ' $@
> --	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
> -+	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
> -
> - install-libreg-headers:
> - 	$(NQ) '  INSTALL  libreg-headers'
> ---
> -1.9.1
> -
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
> deleted file mode 100644
> index c6c3c53f1..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
> +++ /dev/null
> @@ -1,59 +0,0 @@
> -From 1bd6ff9d10c83afbc9954fc38b953e9167e6d4a9 Mon Sep 17 00:00:00 2001
> -From: Khem Raj <raj.khem@gmail.com>
> -Date: Sun, 28 Aug 2022 14:01:55 -0700
> -Subject: [PATCH] reglib: Remove unused variables
> -
> -These counters are not used anywhere therefore delete them
> -Fixes
> -reglib.c:1015:15: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
> -        unsigned int i = 0;
> -                     ^
> -reglib.c:1062:15: error: variable 'lines' set but not used [-Werror,-Wunused-but-set-variable]
> -        unsigned int lines = 0;
> -                     ^
> -
> -Upstream-Status: Pending
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ----
> - reglib.c | 4 ----
> - 1 file changed, 4 deletions(-)
> -
> -diff --git a/reglib.c b/reglib.c
> -index 8565a0b..6c62c2c 100644
> ---- a/reglib.c
> -+++ b/reglib.c
> -@@ -1012,7 +1012,6 @@ static int reglib_find_next_country_stream(FILE *fp)
> - {
> - 	fpos_t prev_pos;
> - 	int r;
> --	unsigned int i = 0;
> -
> - 	while(1) {
> - 		char line[1024];
> -@@ -1030,7 +1029,6 @@ static int reglib_find_next_country_stream(FILE *fp)
> - 		line_p = fgets(line, sizeof(line), fp);
> - 		if (line_p == line) {
> - 			if (strspn(line, "\n") == strlen(line)) {
> --				i++;
> - 				continue;
> - 			}
> - 			if (strncmp(line, "country", 7) != 0)
> -@@ -1059,7 +1057,6 @@ struct ieee80211_regdomain *reglib_parse_country(FILE *fp)
> -
> - FILE *reglib_create_parse_stream(FILE *f)
> - {
> --	unsigned int lines = 0;
> - 	FILE *fp;
> -
> - 	fp = tmpfile();
> -@@ -1076,7 +1073,6 @@ FILE *reglib_create_parse_stream(FILE *f)
> - 		if (line_p == line) {
> - 			if (strchr(line, '#') == NULL) {
> - 				fputs(line, fp);
> --				lines++;
> - 			}
> - 			continue;
> - 		} else
> ---
> -2.37.2
> -
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
> deleted file mode 100644
> index 9125d0ab9..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
> +++ /dev/null
> @@ -1,101 +0,0 @@
> -Imported from Gentoo
> -https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c50acec16bc7c33d6dc122c007d713e7fbecf9c
> -
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> -
> ---- a/utils/key2pub.py
> -+++ b/utils/key2pub.py
> -@@ -1,22 +1,22 @@
> --#!/usr/bin/env python
> -+#!/usr/bin/env python3
> -
> - import sys
> - try:
> -        from M2Crypto import RSA
> --except ImportError, e:
> -+except ImportError as e:
> -        sys.stderr.write('ERROR: Failed to import the "M2Crypto" module: %s\n' % e.message)
> -        sys.stderr.write('Please install the "M2Crypto" Python module.\n')
> -        sys.stderr.write('On Debian GNU/Linux the package is called "python-m2crypto".\n')
> -        sys.exit(1)
> -
> - def print_ssl_64(output, name, val):
> --    while val[0] == '\0':
> -+    while val[0:1] == b'\0':
> -         val = val[1:]
> -     while len(val) % 8:
> --        val = '\0' + val
> -+        val = b'\0' + val
> -     vnew = []
> -     while len(val):
> --        vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]))
> -+        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4], val[4:5], val[5:6], val[6:7], val[7:8]))
> -         val = val[8:]
> -     vnew.reverse()
> -     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
> -@@ -34,13 +34,13 @@ def print_ssl_64(output, name, val):
> -     output.write('};\n\n')
> -
> - def print_ssl_32(output, name, val):
> --    while val[0] == '\0':
> -+    while val[0:1] == b'\0':
> -         val = val[1:]
> -     while len(val) % 4:
> --        val = '\0' + val
> -+        val = b'\0' + val
> -     vnew = []
> -     while len(val):
> --        vnew.append((val[0], val[1], val[2], val[3], ))
> -+        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4]))
> -         val = val[4:]
> -     vnew.reverse()
> -     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
> -@@ -81,21 +81,21 @@ struct pubkey {
> -
> - static struct pubkey keys[] __attribute__((unused))= {
> - ''')
> --    for n in xrange(n + 1):
> -+    for n in range(n + 1):
> -         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
> -     output.write('};\n')
> -     pass
> -
> - def print_gcrypt(output, name, val):
> -     output.write('#include <stdint.h>\n')
> --    while val[0] == '\0':
> -+    while val[0:1] == b'\0':
> -         val = val[1:]
> -     output.write('static const uint8_t %s[%d] = {\n' % (name, len(val)))
> -     idx = 0
> -     for v in val:
> -         if not idx:
> -             output.write('\t')
> --        output.write('0x%.2x, ' % ord(v))
> -+        output.write('0x%.2x, ' % (v if sys.version_info[0] >=3 else ord(v)))
> -         idx += 1
> -         if idx == 8:
> -             idx = 0
> -@@ -118,7 +118,7 @@ struct key_params {
> -
> - static const struct key_params keys[] __attribute__((unused))= {
> - ''')
> --    for n in xrange(n + 1):
> -+    for n in range(n + 1):
> -         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
> -     output.write('};\n')
> -
> -@@ -136,7 +136,7 @@ except IndexError:
> -     mode = None
> -
> - if not mode in modes:
> --    print 'Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys()))
> -+    print('Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys())))
> -     sys.exit(2)
> -
> - output = open(outfile, 'w')
> -@@ -154,3 +154,5 @@ for f in files:
> -     idx += 1
> -
> - modes[mode][1](output, idx - 1)
> -+
> -+output.close()
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
> deleted file mode 100644
> index 3ef35ee54..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
> +++ /dev/null
> @@ -1,21 +0,0 @@
> -From: Ben Hutchings <ben@decadent.org.uk>
> -Date: Sat, 23 Aug 2014 12:27:34 -0700
> -Subject: crda: Do not run ldconfig if DESTDIR is set
> -
> -Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126028.html]
> -
> -Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> -Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> -
> ---- a/Makefile
> -+++ b/Makefile
> -@@ -132,7 +132,9 @@ install-libreg:
> - 	$(NQ) '  INSTALL  libreg'
> - 	$(Q)mkdir -p $(DESTDIR)/$(LIBDIR)
> - 	$(Q)cp $(LIBREG) $(DESTDIR)/$(LIBDIR)/
> -+ifndef DESTDIR
> - 	$(Q)ldconfig
> -+endif
> -
> - %.o: %.c regdb.h $(LIBREG)
> - 	$(NQ) '  CC  ' $@
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
> deleted file mode 100644
> index 747804d34..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
> +++ /dev/null
> @@ -1,11 +0,0 @@
> ---- crda-3.18/utils/key2pub.py.orig	2016-06-18 09:54:23.671326113 -0400
> -+++ crda-3.18/utils/key2pub.py	2016-06-18 09:54:34.387326300 -0400
> -@@ -115,7 +115,7 @@
> - 	.n = _n, .len_n = sizeof(_n),	\
> - }
> -
> --static const struct key_params keys[] = {
> -+static const struct key_params keys[] __attribute__((unused))= {
> - ''')
> -     for n in xrange(n + 1):
> -         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
> deleted file mode 100644
> index 1bb5c638f..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
> +++ /dev/null
> @@ -1,58 +0,0 @@
> -From 8d2164a090f17286ea8291f30a123595cf447dc3 Mon Sep 17 00:00:00 2001
> -From: Haiqing Bai <Haiqing.Bai@windriver.com>
> -Date: Wed, 30 Nov 2016 10:27:36 +0800
> -Subject: [PATCH] crda: fix issues when 'USE_OPENSSL=1'.
> -
> -Fxed the below issues if configured with 'USE_OPENSSL=1':
> -a. keys-ssl.c uses BN_ULONG but doesn't include the openssl headers leading
> -   to build failures:
> -   keys-ssl.c:2:8: error: unknown type name 'BN_ULONG'
> -   static BN_ULONG e_0[1] = {
> -
> -b. The large unqualified constants also break building:
> -   keys-ssl.c:8:2: warning: overflow in implicit constant conversion [-Woverflow]
> -     0x63a2705416a0d8e1, 0xdc9fca11c8ba757b,
> -
> -c. keys-ssl.c: error: 'keys' defined but not used [-Werror=unused-variable]
> -   static struct pubkey keys[] = {
> -
> -Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> -Upstream-Status: Pending
> -Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
> ----
> - utils/key2pub.py | 5 +++--
> - 1 file changed, 3 insertions(+), 2 deletions(-)
> -
> -diff --git a/utils/key2pub.py b/utils/key2pub.py
> -index 401d58a..3ae00b8 100755
> ---- a/utils/key2pub.py
> -+++ b/utils/key2pub.py
> -@@ -24,7 +24,7 @@ def print_ssl_64(output, name, val):
> -     for v1, v2, v3, v4, v5, v6, v7, v8 in vnew:
> -         if not idx:
> -             output.write('\t')
> --        output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
> -+        output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2xULL, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
> -         idx += 1
> -         if idx == 2:
> -             idx = 0
> -@@ -60,6 +60,7 @@ def print_ssl_32(output, name, val):
> - def print_ssl(output, name, val):
> -     import os
> -     output.write('#include <stdint.h>\n')
> -+    output.write('#include <openssl/bn.h>\n')
> -     if os.getenv('TARGET_BITS') == '64':
> -         return print_ssl_64(output, name, val)
> -     else:
> -@@ -78,7 +79,7 @@ struct pubkey {
> -
> - #define KEYS(e,n)	{ KEY(e), KEY(n), }
> -
> --static struct pubkey keys[] = {
> -+static struct pubkey keys[] __attribute__((unused))= {
> - ''')
> -     for n in xrange(n + 1):
> -         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
> ---
> -1.9.1
> -
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
> deleted file mode 100644
> index 812e98379..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
> +++ /dev/null
> @@ -1,57 +0,0 @@
> -From 890f5bf2654b695a866262d72bfa9750af921a3b Mon Sep 17 00:00:00 2001
> -From: Ben Hutchings <ben@decadent.org.uk>
> -Date: Sat, 23 Aug 2014 12:26:37 -0700
> -Subject: [PATCH] Fix linking of libraries used by libreg
> -
> -The math and crypto libraries are called by and need to be linked to
> -libreg.so, not to the executables.
> -
> -Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126027.html]
> -
> -Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> -Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> ----
> - Makefile | 8 ++++----
> - 1 file changed, 4 insertions(+), 4 deletions(-)
> -
> -diff --git a/Makefile b/Makefile
> -index a3ead30..da2dcc3 100644
> ---- a/Makefile
> -+++ b/Makefile
> -@@ -30,7 +30,7 @@ CFLAGS += -std=gnu99 -Wall -Werror -pedantic
> - CFLAGS += -Wall -g
> - LDLIBREG += -lreg
> - LDLIBS += $(LDLIBREG)
> --LDLIBS += -lm
> -+LIBREGLDLIBS += -lm
> - LIBREG += libreg.so
> - LDFLAGS += -L ./
> -
> -@@ -40,13 +40,13 @@ all_noverify: $(LIBREG) crda intersect regdbdump db2rd optimize
> -
> - ifeq ($(USE_OPENSSL),1)
> - CFLAGS += -DUSE_OPENSSL -DPUBKEY_DIR=\"$(RUNTIME_PUBKEY_DIR)\" `pkg-config --cflags openssl`
> --LDLIBS += `pkg-config --libs openssl`
> -+LIBREGLDLIBS += `pkg-config --libs openssl`
> -
> - $(LIBREG): keys-ssl.c
> -
> - else
> - CFLAGS += -DUSE_GCRYPT
> --LDLIBS += -lgcrypt
> -+LIBREGLDLIBS += -lgcrypt
> -
> - $(LIBREG): keys-gcrypt.c
> -
> -@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
> -
> - $(LIBREG): regdb.h reglib.h reglib.c
> - 	$(NQ) '  CC  ' $@
> --	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^
> -+	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
> -
> - install-libreg-headers:
> - 	$(NQ) '  INSTALL  libreg-headers'
> ---
> -2.7.4
> -
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
> deleted file mode 100644
> index 0b737852c..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
> +++ /dev/null
> @@ -1,25 +0,0 @@
> -These headers are not related to any Make rule but they do appear in
> -compiling of libreg.so, specifying .h files in compiler cmdline is flagged
> -as error by clang
> -
> -| clang-4.0: error: cannot specify -o when generating multiple output files
> -| make: *** [libreg.so] Error 1
> -
> -This is how we see headers in cmdline
> --O2 -fpic -std=gnu
> -99 -Wall -Werror -pedantic -Wall -g -DUSE_GCRYPT -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0`  -o libreg.so -shared -Wl,-soname,libreg.so
> -regdb.h reglib.h reglib.c keys-gcrypt.c -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -L ./ -lm -lgcrypt
> -
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> -
> ---- a/Makefile.kk	2016-11-15 04:54:53.338670000 +0000
> -+++ a/Makefile	2016-11-15 04:55:07.718670000 +0000
> -@@ -114,7 +114,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(
> - 	$(NQ) '  Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
> - 	$(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
> -
> --$(LIBREG): regdb.h reglib.h reglib.c
> -+$(LIBREG): reglib.c
> - 	$(NQ) '  CC  ' $@
> - 	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
> -
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
> deleted file mode 100644
> index 100b765f2..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
> +++ /dev/null
> @@ -1,34 +0,0 @@
> -From c1c42513edd27c97341f2033af77c13a4724eb8f Mon Sep 17 00:00:00 2001
> -From: Haiqing Bai <Haiqing.Bai@windriver.com>
> -Date: Fri, 25 Nov 2016 16:48:01 +0800
> -Subject: [PATCH] crda: Use target word size instead of host's.
> -
> -In key2pub.py, the codes check the wordsize
> -of the host machine but not the target's, this fix
> -fetches the wordsize of target from the build system.
> -
> -Upstream-Status: Pending
> -Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
> ----
> - utils/key2pub.py | 4 ++--
> - 1 file changed, 2 insertions(+), 2 deletions(-)
> -
> -diff --git a/utils/key2pub.py b/utils/key2pub.py
> -index 3e84cd2..401d58a 100755
> ---- a/utils/key2pub.py
> -+++ b/utils/key2pub.py
> -@@ -58,9 +58,9 @@ def print_ssl_32(output, name, val):
> -     output.write('};\n\n')
> -
> - def print_ssl(output, name, val):
> --    import struct
> -+    import os
> -     output.write('#include <stdint.h>\n')
> --    if len(struct.pack('@L', 0)) == 8:
> -+    if os.getenv('TARGET_BITS') == '64':
> -         return print_ssl_64(output, name, val)
> -     else:
> -         return print_ssl_32(output, name, val)
> ---
> -1.9.1
> -
> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
> deleted file mode 100644
> index 2f4d4dac9..000000000
> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -SUMMARY = "Wireless Central Regulatory Domain Agent"
> -HOMEPAGE = "http://wireless.kernel.org/en/developers/Regulatory/CRDA"
> -SECTION = "net"
> -LICENSE = "copyleft-next-0.3.0"
> -LIC_FILES_CHKSUM = "file://copyleft-next-0.3.0;md5=8743a2c359037d4d329a31e79eabeffe"
> -
> -DEPENDS = "python3-m2crypto-native libnl libgcrypt"
> -
> -SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz \
> -           file://do-not-run-ldconfig-if-destdir-is-set.patch \
> -           file://fix-linking-of-libraries-used-by-reglib.patch \
> -           file://fix-gcc-6-unused-variables.patch \
> -           file://0001-Makefile-respect-LDFLAGS-for-libreg.patch \
> -           file://make.patch \
> -           file://use-target-word-size-instead-of-host-s.patch \
> -           file://fix-issues-when-USE_OPENSSL-1.patch \
> -           file://crda-4.14-python-3.patch \
> -           file://0001-Make-alpha2-to-be-3-characters-long.patch \
> -           file://0001-reglib-Remove-unused-variables.patch \
> -"
> -SRC_URI[md5sum] = "0431fef3067bf503dfb464069f06163a"
> -SRC_URI[sha256sum] = "43fcb9679f8b75ed87ad10944a506292def13e4afb194afa7aa921b01e8ecdbf"
> -
> -inherit pkgconfig python3-dir python3native siteinfo
> -
> -# Recursive make problem
> -EXTRA_OEMAKE = "MAKEFLAGS= DESTDIR=${D} LIBDIR=${libdir}/crda LDLIBREG='-Wl,-rpath,${libdir}/crda -lreg' \
> -                UDEV_RULE_DIR=${nonarch_base_libdir}/udev/rules.d/"
> -TARGET_BITS = "${SITEINFO_BITS}"
> -export TARGET_BITS
> -
> -do_compile() {
> -    oe_runmake all_noverify
> -}
> -
> -do_install() {
> -    oe_runmake SBINDIR=${sbindir}/ install
> -}
> -
> -RDEPENDS:${PN} = "udev wireless-regdb"
Khem Raj Jan. 19, 2023, 4:46 p.m. UTC | #2
On Thu, Jan 19, 2023 at 3:34 AM Randy MacLeod
<randy.macleod@windriver.com> wrote:
>
> Add Theo, who changed crda earlier this year:

And this patch also needs rebasing on top of master or master-next

>
>    https://lists.openembedded.org/g/openembedded-devel/message/97671
>
> Does anyone really still need crda?
>
> ../Randy
>
> On 2023-01-19 03:37, kai.kang@windriver.com wrote:
> > From: Kai Kang <kai.kang@windriver.com>
> >
> > CRDA is no longer needed as of kernel v4.15 since commit 007f6c5e6eb45
> > ("cfg80211: support loading regulatory database as firmware file") added
> > support to use the kernel's firmware request API which looks for the
> > firmware on /lib/firmware. Because of this CRDA is legacy software for
> > older kernels, remove the recipe.
> >
> > It could change regulatory domains with iw and wpa_supplicant.
> >
> > Refs
> > 1. https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git/tree/README#n8
> > 2. https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA
> >
> > Signed-off-by: Kai Kang <kai.kang@windriver.com>
> > ---
> >   ...-Make-alpha2-to-be-3-characters-long.patch |  31 ------
> >   ...-Makefile-respect-LDFLAGS-for-libreg.patch |  29 -----
> >   .../0001-reglib-Remove-unused-variables.patch |  59 ----------
> >   .../crda/crda/crda-4.14-python-3.patch        | 101 ------------------
> >   ...o-not-run-ldconfig-if-destdir-is-set.patch |  21 ----
> >   .../crda/fix-gcc-6-unused-variables.patch     |  11 --
> >   .../crda/fix-issues-when-USE_OPENSSL-1.patch  |  58 ----------
> >   ...-linking-of-libraries-used-by-reglib.patch |  57 ----------
> >   .../recipes-connectivity/crda/crda/make.patch |  25 -----
> >   ...e-target-word-size-instead-of-host-s.patch |  34 ------
> >   .../recipes-connectivity/crda/crda_3.18.bb    |  40 -------
> >   11 files changed, 466 deletions(-)
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
> >   delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
> >
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
> > deleted file mode 100644
> > index f1d2cbc5a..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
> > +++ /dev/null
> > @@ -1,31 +0,0 @@
> > -From 078e962d345fd0536fe7ba797485ee1a4159c032 Mon Sep 17 00:00:00 2001
> > -From: Khem Raj <raj.khem@gmail.com>
> > -Date: Fri, 4 Feb 2022 09:18:30 -0800
> > -Subject: [PATCH] Make alpha2 to be 3 characters long
> > -
> > -Fixes buffer overflow
> > -reglib.c:969:9: error: 'sscanf' may overflow; destination buffer in argument 3 has size 2, but the corresponding specifier may require size 3 [-Werror,-Wfortify-source]
> > -                      alpha2,
> > -                      ^
> > -Upstream-Status: Pending
> > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ----
> > - reglib.c | 2 +-
> > - 1 file changed, 1 insertion(+), 1 deletion(-)
> > -
> > -diff --git a/reglib.c b/reglib.c
> > -index e00e9b8..8565a0b 100644
> > ---- a/reglib.c
> > -+++ b/reglib.c
> > -@@ -958,7 +958,7 @@ reglib_parse_rules(FILE *fp, struct ieee80211_regdomain *trd)
> > - static int reglib_parse_country_dfs(char *line, struct ieee80211_regdomain *rd)
> > - {
> > -     char dfs_region_alpha[9];
> > --    char alpha2[2];
> > -+    char alpha2[3];
> > -     int hits;
> > -
> > -     memset(rd, 0, sizeof(*rd));
> > ---
> > -2.35.1
> > -
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
> > deleted file mode 100644
> > index 16800d506..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
> > +++ /dev/null
> > @@ -1,29 +0,0 @@
> > -From 1e1a78b7b4fa1662b4447aa19c15b1e839b7e9db Mon Sep 17 00:00:00 2001
> > -From: =?UTF-8?q?Stefan=20M=C3=BCller-Klieser?= <s.mueller-klieser@phytec.de>
> > -Date: Wed, 24 Aug 2016 10:58:45 +0200
> > -Subject: [PATCH] Makefile: respect LDFLAGS for libreg
> > -MIME-Version: 1.0
> > -Content-Type: text/plain; charset=UTF-8
> > -Content-Transfer-Encoding: 8bit
> > -
> > -Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
> > ----
> > - Makefile | 2 +-
> > - 1 file changed, 1 insertion(+), 1 deletion(-)
> > -
> > -diff --git a/Makefile b/Makefile
> > -index 2879896..1650db8 100644
> > ---- a/Makefile
> > -+++ b/Makefile
> > -@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
> > -
> > - $(LIBREG): regdb.h reglib.h reglib.c
> > -     $(NQ) '  CC  ' $@
> > --    $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
> > -+    $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
> > -
> > - install-libreg-headers:
> > -     $(NQ) '  INSTALL  libreg-headers'
> > ---
> > -1.9.1
> > -
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
> > deleted file mode 100644
> > index c6c3c53f1..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
> > +++ /dev/null
> > @@ -1,59 +0,0 @@
> > -From 1bd6ff9d10c83afbc9954fc38b953e9167e6d4a9 Mon Sep 17 00:00:00 2001
> > -From: Khem Raj <raj.khem@gmail.com>
> > -Date: Sun, 28 Aug 2022 14:01:55 -0700
> > -Subject: [PATCH] reglib: Remove unused variables
> > -
> > -These counters are not used anywhere therefore delete them
> > -Fixes
> > -reglib.c:1015:15: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
> > -        unsigned int i = 0;
> > -                     ^
> > -reglib.c:1062:15: error: variable 'lines' set but not used [-Werror,-Wunused-but-set-variable]
> > -        unsigned int lines = 0;
> > -                     ^
> > -
> > -Upstream-Status: Pending
> > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ----
> > - reglib.c | 4 ----
> > - 1 file changed, 4 deletions(-)
> > -
> > -diff --git a/reglib.c b/reglib.c
> > -index 8565a0b..6c62c2c 100644
> > ---- a/reglib.c
> > -+++ b/reglib.c
> > -@@ -1012,7 +1012,6 @@ static int reglib_find_next_country_stream(FILE *fp)
> > - {
> > -     fpos_t prev_pos;
> > -     int r;
> > --    unsigned int i = 0;
> > -
> > -     while(1) {
> > -             char line[1024];
> > -@@ -1030,7 +1029,6 @@ static int reglib_find_next_country_stream(FILE *fp)
> > -             line_p = fgets(line, sizeof(line), fp);
> > -             if (line_p == line) {
> > -                     if (strspn(line, "\n") == strlen(line)) {
> > --                            i++;
> > -                             continue;
> > -                     }
> > -                     if (strncmp(line, "country", 7) != 0)
> > -@@ -1059,7 +1057,6 @@ struct ieee80211_regdomain *reglib_parse_country(FILE *fp)
> > -
> > - FILE *reglib_create_parse_stream(FILE *f)
> > - {
> > --    unsigned int lines = 0;
> > -     FILE *fp;
> > -
> > -     fp = tmpfile();
> > -@@ -1076,7 +1073,6 @@ FILE *reglib_create_parse_stream(FILE *f)
> > -             if (line_p == line) {
> > -                     if (strchr(line, '#') == NULL) {
> > -                             fputs(line, fp);
> > --                            lines++;
> > -                     }
> > -                     continue;
> > -             } else
> > ---
> > -2.37.2
> > -
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
> > deleted file mode 100644
> > index 9125d0ab9..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
> > +++ /dev/null
> > @@ -1,101 +0,0 @@
> > -Imported from Gentoo
> > -https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c50acec16bc7c33d6dc122c007d713e7fbecf9c
> > -
> > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > -
> > ---- a/utils/key2pub.py
> > -+++ b/utils/key2pub.py
> > -@@ -1,22 +1,22 @@
> > --#!/usr/bin/env python
> > -+#!/usr/bin/env python3
> > -
> > - import sys
> > - try:
> > -        from M2Crypto import RSA
> > --except ImportError, e:
> > -+except ImportError as e:
> > -        sys.stderr.write('ERROR: Failed to import the "M2Crypto" module: %s\n' % e.message)
> > -        sys.stderr.write('Please install the "M2Crypto" Python module.\n')
> > -        sys.stderr.write('On Debian GNU/Linux the package is called "python-m2crypto".\n')
> > -        sys.exit(1)
> > -
> > - def print_ssl_64(output, name, val):
> > --    while val[0] == '\0':
> > -+    while val[0:1] == b'\0':
> > -         val = val[1:]
> > -     while len(val) % 8:
> > --        val = '\0' + val
> > -+        val = b'\0' + val
> > -     vnew = []
> > -     while len(val):
> > --        vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]))
> > -+        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4], val[4:5], val[5:6], val[6:7], val[7:8]))
> > -         val = val[8:]
> > -     vnew.reverse()
> > -     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
> > -@@ -34,13 +34,13 @@ def print_ssl_64(output, name, val):
> > -     output.write('};\n\n')
> > -
> > - def print_ssl_32(output, name, val):
> > --    while val[0] == '\0':
> > -+    while val[0:1] == b'\0':
> > -         val = val[1:]
> > -     while len(val) % 4:
> > --        val = '\0' + val
> > -+        val = b'\0' + val
> > -     vnew = []
> > -     while len(val):
> > --        vnew.append((val[0], val[1], val[2], val[3], ))
> > -+        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4]))
> > -         val = val[4:]
> > -     vnew.reverse()
> > -     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
> > -@@ -81,21 +81,21 @@ struct pubkey {
> > -
> > - static struct pubkey keys[] __attribute__((unused))= {
> > - ''')
> > --    for n in xrange(n + 1):
> > -+    for n in range(n + 1):
> > -         output.write('      KEYS(e_%d, n_%d),\n' % (n, n))
> > -     output.write('};\n')
> > -     pass
> > -
> > - def print_gcrypt(output, name, val):
> > -     output.write('#include <stdint.h>\n')
> > --    while val[0] == '\0':
> > -+    while val[0:1] == b'\0':
> > -         val = val[1:]
> > -     output.write('static const uint8_t %s[%d] = {\n' % (name, len(val)))
> > -     idx = 0
> > -     for v in val:
> > -         if not idx:
> > -             output.write('\t')
> > --        output.write('0x%.2x, ' % ord(v))
> > -+        output.write('0x%.2x, ' % (v if sys.version_info[0] >=3 else ord(v)))
> > -         idx += 1
> > -         if idx == 8:
> > -             idx = 0
> > -@@ -118,7 +118,7 @@ struct key_params {
> > -
> > - static const struct key_params keys[] __attribute__((unused))= {
> > - ''')
> > --    for n in xrange(n + 1):
> > -+    for n in range(n + 1):
> > -         output.write('      KEYS(e_%d, n_%d),\n' % (n, n))
> > -     output.write('};\n')
> > -
> > -@@ -136,7 +136,7 @@ except IndexError:
> > -     mode = None
> > -
> > - if not mode in modes:
> > --    print 'Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys()))
> > -+    print('Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys())))
> > -     sys.exit(2)
> > -
> > - output = open(outfile, 'w')
> > -@@ -154,3 +154,5 @@ for f in files:
> > -     idx += 1
> > -
> > - modes[mode][1](output, idx - 1)
> > -+
> > -+output.close()
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
> > deleted file mode 100644
> > index 3ef35ee54..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
> > +++ /dev/null
> > @@ -1,21 +0,0 @@
> > -From: Ben Hutchings <ben@decadent.org.uk>
> > -Date: Sat, 23 Aug 2014 12:27:34 -0700
> > -Subject: crda: Do not run ldconfig if DESTDIR is set
> > -
> > -Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126028.html]
> > -
> > -Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > -Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> > -
> > ---- a/Makefile
> > -+++ b/Makefile
> > -@@ -132,7 +132,9 @@ install-libreg:
> > -     $(NQ) '  INSTALL  libreg'
> > -     $(Q)mkdir -p $(DESTDIR)/$(LIBDIR)
> > -     $(Q)cp $(LIBREG) $(DESTDIR)/$(LIBDIR)/
> > -+ifndef DESTDIR
> > -     $(Q)ldconfig
> > -+endif
> > -
> > - %.o: %.c regdb.h $(LIBREG)
> > -     $(NQ) '  CC  ' $@
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
> > deleted file mode 100644
> > index 747804d34..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
> > +++ /dev/null
> > @@ -1,11 +0,0 @@
> > ---- crda-3.18/utils/key2pub.py.orig  2016-06-18 09:54:23.671326113 -0400
> > -+++ crda-3.18/utils/key2pub.py       2016-06-18 09:54:34.387326300 -0400
> > -@@ -115,7 +115,7 @@
> > -     .n = _n, .len_n = sizeof(_n),   \
> > - }
> > -
> > --static const struct key_params keys[] = {
> > -+static const struct key_params keys[] __attribute__((unused))= {
> > - ''')
> > -     for n in xrange(n + 1):
> > -         output.write('      KEYS(e_%d, n_%d),\n' % (n, n))
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
> > deleted file mode 100644
> > index 1bb5c638f..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
> > +++ /dev/null
> > @@ -1,58 +0,0 @@
> > -From 8d2164a090f17286ea8291f30a123595cf447dc3 Mon Sep 17 00:00:00 2001
> > -From: Haiqing Bai <Haiqing.Bai@windriver.com>
> > -Date: Wed, 30 Nov 2016 10:27:36 +0800
> > -Subject: [PATCH] crda: fix issues when 'USE_OPENSSL=1'.
> > -
> > -Fxed the below issues if configured with 'USE_OPENSSL=1':
> > -a. keys-ssl.c uses BN_ULONG but doesn't include the openssl headers leading
> > -   to build failures:
> > -   keys-ssl.c:2:8: error: unknown type name 'BN_ULONG'
> > -   static BN_ULONG e_0[1] = {
> > -
> > -b. The large unqualified constants also break building:
> > -   keys-ssl.c:8:2: warning: overflow in implicit constant conversion [-Woverflow]
> > -     0x63a2705416a0d8e1, 0xdc9fca11c8ba757b,
> > -
> > -c. keys-ssl.c: error: 'keys' defined but not used [-Werror=unused-variable]
> > -   static struct pubkey keys[] = {
> > -
> > -Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> > -Upstream-Status: Pending
> > -Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
> > ----
> > - utils/key2pub.py | 5 +++--
> > - 1 file changed, 3 insertions(+), 2 deletions(-)
> > -
> > -diff --git a/utils/key2pub.py b/utils/key2pub.py
> > -index 401d58a..3ae00b8 100755
> > ---- a/utils/key2pub.py
> > -+++ b/utils/key2pub.py
> > -@@ -24,7 +24,7 @@ def print_ssl_64(output, name, val):
> > -     for v1, v2, v3, v4, v5, v6, v7, v8 in vnew:
> > -         if not idx:
> > -             output.write('\t')
> > --        output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
> > -+        output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2xULL, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
> > -         idx += 1
> > -         if idx == 2:
> > -             idx = 0
> > -@@ -60,6 +60,7 @@ def print_ssl_32(output, name, val):
> > - def print_ssl(output, name, val):
> > -     import os
> > -     output.write('#include <stdint.h>\n')
> > -+    output.write('#include <openssl/bn.h>\n')
> > -     if os.getenv('TARGET_BITS') == '64':
> > -         return print_ssl_64(output, name, val)
> > -     else:
> > -@@ -78,7 +79,7 @@ struct pubkey {
> > -
> > - #define KEYS(e,n)   { KEY(e), KEY(n), }
> > -
> > --static struct pubkey keys[] = {
> > -+static struct pubkey keys[] __attribute__((unused))= {
> > - ''')
> > -     for n in xrange(n + 1):
> > -         output.write('      KEYS(e_%d, n_%d),\n' % (n, n))
> > ---
> > -1.9.1
> > -
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
> > deleted file mode 100644
> > index 812e98379..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
> > +++ /dev/null
> > @@ -1,57 +0,0 @@
> > -From 890f5bf2654b695a866262d72bfa9750af921a3b Mon Sep 17 00:00:00 2001
> > -From: Ben Hutchings <ben@decadent.org.uk>
> > -Date: Sat, 23 Aug 2014 12:26:37 -0700
> > -Subject: [PATCH] Fix linking of libraries used by libreg
> > -
> > -The math and crypto libraries are called by and need to be linked to
> > -libreg.so, not to the executables.
> > -
> > -Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126027.html]
> > -
> > -Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > -Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> > ----
> > - Makefile | 8 ++++----
> > - 1 file changed, 4 insertions(+), 4 deletions(-)
> > -
> > -diff --git a/Makefile b/Makefile
> > -index a3ead30..da2dcc3 100644
> > ---- a/Makefile
> > -+++ b/Makefile
> > -@@ -30,7 +30,7 @@ CFLAGS += -std=gnu99 -Wall -Werror -pedantic
> > - CFLAGS += -Wall -g
> > - LDLIBREG += -lreg
> > - LDLIBS += $(LDLIBREG)
> > --LDLIBS += -lm
> > -+LIBREGLDLIBS += -lm
> > - LIBREG += libreg.so
> > - LDFLAGS += -L ./
> > -
> > -@@ -40,13 +40,13 @@ all_noverify: $(LIBREG) crda intersect regdbdump db2rd optimize
> > -
> > - ifeq ($(USE_OPENSSL),1)
> > - CFLAGS += -DUSE_OPENSSL -DPUBKEY_DIR=\"$(RUNTIME_PUBKEY_DIR)\" `pkg-config --cflags openssl`
> > --LDLIBS += `pkg-config --libs openssl`
> > -+LIBREGLDLIBS += `pkg-config --libs openssl`
> > -
> > - $(LIBREG): keys-ssl.c
> > -
> > - else
> > - CFLAGS += -DUSE_GCRYPT
> > --LDLIBS += -lgcrypt
> > -+LIBREGLDLIBS += -lgcrypt
> > -
> > - $(LIBREG): keys-gcrypt.c
> > -
> > -@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
> > -
> > - $(LIBREG): regdb.h reglib.h reglib.c
> > -     $(NQ) '  CC  ' $@
> > --    $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^
> > -+    $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
> > -
> > - install-libreg-headers:
> > -     $(NQ) '  INSTALL  libreg-headers'
> > ---
> > -2.7.4
> > -
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
> > deleted file mode 100644
> > index 0b737852c..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
> > +++ /dev/null
> > @@ -1,25 +0,0 @@
> > -These headers are not related to any Make rule but they do appear in
> > -compiling of libreg.so, specifying .h files in compiler cmdline is flagged
> > -as error by clang
> > -
> > -| clang-4.0: error: cannot specify -o when generating multiple output files
> > -| make: *** [libreg.so] Error 1
> > -
> > -This is how we see headers in cmdline
> > --O2 -fpic -std=gnu
> > -99 -Wall -Werror -pedantic -Wall -g -DUSE_GCRYPT -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0`  -o libreg.so -shared -Wl,-soname,libreg.so
> > -regdb.h reglib.h reglib.c keys-gcrypt.c -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -L ./ -lm -lgcrypt
> > -
> > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > -
> > ---- a/Makefile.kk    2016-11-15 04:54:53.338670000 +0000
> > -+++ a/Makefile       2016-11-15 04:55:07.718670000 +0000
> > -@@ -114,7 +114,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(
> > -     $(NQ) '  Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
> > -     $(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
> > -
> > --$(LIBREG): regdb.h reglib.h reglib.c
> > -+$(LIBREG): reglib.c
> > -     $(NQ) '  CC  ' $@
> > -     $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
> > -
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
> > deleted file mode 100644
> > index 100b765f2..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
> > +++ /dev/null
> > @@ -1,34 +0,0 @@
> > -From c1c42513edd27c97341f2033af77c13a4724eb8f Mon Sep 17 00:00:00 2001
> > -From: Haiqing Bai <Haiqing.Bai@windriver.com>
> > -Date: Fri, 25 Nov 2016 16:48:01 +0800
> > -Subject: [PATCH] crda: Use target word size instead of host's.
> > -
> > -In key2pub.py, the codes check the wordsize
> > -of the host machine but not the target's, this fix
> > -fetches the wordsize of target from the build system.
> > -
> > -Upstream-Status: Pending
> > -Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
> > ----
> > - utils/key2pub.py | 4 ++--
> > - 1 file changed, 2 insertions(+), 2 deletions(-)
> > -
> > -diff --git a/utils/key2pub.py b/utils/key2pub.py
> > -index 3e84cd2..401d58a 100755
> > ---- a/utils/key2pub.py
> > -+++ b/utils/key2pub.py
> > -@@ -58,9 +58,9 @@ def print_ssl_32(output, name, val):
> > -     output.write('};\n\n')
> > -
> > - def print_ssl(output, name, val):
> > --    import struct
> > -+    import os
> > -     output.write('#include <stdint.h>\n')
> > --    if len(struct.pack('@L', 0)) == 8:
> > -+    if os.getenv('TARGET_BITS') == '64':
> > -         return print_ssl_64(output, name, val)
> > -     else:
> > -         return print_ssl_32(output, name, val)
> > ---
> > -1.9.1
> > -
> > diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
> > deleted file mode 100644
> > index 2f4d4dac9..000000000
> > --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
> > +++ /dev/null
> > @@ -1,40 +0,0 @@
> > -SUMMARY = "Wireless Central Regulatory Domain Agent"
> > -HOMEPAGE = "http://wireless.kernel.org/en/developers/Regulatory/CRDA"
> > -SECTION = "net"
> > -LICENSE = "copyleft-next-0.3.0"
> > -LIC_FILES_CHKSUM = "file://copyleft-next-0.3.0;md5=8743a2c359037d4d329a31e79eabeffe"
> > -
> > -DEPENDS = "python3-m2crypto-native libnl libgcrypt"
> > -
> > -SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz \
> > -           file://do-not-run-ldconfig-if-destdir-is-set.patch \
> > -           file://fix-linking-of-libraries-used-by-reglib.patch \
> > -           file://fix-gcc-6-unused-variables.patch \
> > -           file://0001-Makefile-respect-LDFLAGS-for-libreg.patch \
> > -           file://make.patch \
> > -           file://use-target-word-size-instead-of-host-s.patch \
> > -           file://fix-issues-when-USE_OPENSSL-1.patch \
> > -           file://crda-4.14-python-3.patch \
> > -           file://0001-Make-alpha2-to-be-3-characters-long.patch \
> > -           file://0001-reglib-Remove-unused-variables.patch \
> > -"
> > -SRC_URI[md5sum] = "0431fef3067bf503dfb464069f06163a"
> > -SRC_URI[sha256sum] = "43fcb9679f8b75ed87ad10944a506292def13e4afb194afa7aa921b01e8ecdbf"
> > -
> > -inherit pkgconfig python3-dir python3native siteinfo
> > -
> > -# Recursive make problem
> > -EXTRA_OEMAKE = "MAKEFLAGS= DESTDIR=${D} LIBDIR=${libdir}/crda LDLIBREG='-Wl,-rpath,${libdir}/crda -lreg' \
> > -                UDEV_RULE_DIR=${nonarch_base_libdir}/udev/rules.d/"
> > -TARGET_BITS = "${SITEINFO_BITS}"
> > -export TARGET_BITS
> > -
> > -do_compile() {
> > -    oe_runmake all_noverify
> > -}
> > -
> > -do_install() {
> > -    oe_runmake SBINDIR=${sbindir}/ install
> > -}
> > -
> > -RDEPENDS:${PN} = "udev wireless-regdb"
>
> --
> # Randy MacLeod
> # Wind River Linux
>
Kai Jan. 20, 2023, 1:32 a.m. UTC | #3
On 1/20/23 00:46, Khem Raj wrote:
> On Thu, Jan 19, 2023 at 3:34 AM Randy MacLeod
> <randy.macleod@windriver.com> wrote:
>> Add Theo, who changed crda earlier this year:
> And this patch also needs rebasing on top of master or master-next
I am sorry that I've sent patch to update crda to 4.15. But without more 
thinking, I suppose the recipes

should be removed since we have 5.15 kernel already. Please drop the 
previous recipe update patch.

Thanks,
Kai

>
>>     https://lists.openembedded.org/g/openembedded-devel/message/97671
>>
>> Does anyone really still need crda?
>>
>> ../Randy
>>
>> On 2023-01-19 03:37, kai.kang@windriver.com wrote:
>>> From: Kai Kang <kai.kang@windriver.com>
>>>
>>> CRDA is no longer needed as of kernel v4.15 since commit 007f6c5e6eb45
>>> ("cfg80211: support loading regulatory database as firmware file") added
>>> support to use the kernel's firmware request API which looks for the
>>> firmware on /lib/firmware. Because of this CRDA is legacy software for
>>> older kernels, remove the recipe.
>>>
>>> It could change regulatory domains with iw and wpa_supplicant.
>>>
>>> Refs
>>> 1. https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git/tree/README#n8
>>> 2. https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA
>>>
>>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>>> ---
>>>    ...-Make-alpha2-to-be-3-characters-long.patch |  31 ------
>>>    ...-Makefile-respect-LDFLAGS-for-libreg.patch |  29 -----
>>>    .../0001-reglib-Remove-unused-variables.patch |  59 ----------
>>>    .../crda/crda/crda-4.14-python-3.patch        | 101 ------------------
>>>    ...o-not-run-ldconfig-if-destdir-is-set.patch |  21 ----
>>>    .../crda/fix-gcc-6-unused-variables.patch     |  11 --
>>>    .../crda/fix-issues-when-USE_OPENSSL-1.patch  |  58 ----------
>>>    ...-linking-of-libraries-used-by-reglib.patch |  57 ----------
>>>    .../recipes-connectivity/crda/crda/make.patch |  25 -----
>>>    ...e-target-word-size-instead-of-host-s.patch |  34 ------
>>>    .../recipes-connectivity/crda/crda_3.18.bb    |  40 -------
>>>    11 files changed, 466 deletions(-)
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
>>>    delete mode 100644 meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
>>>
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
>>> deleted file mode 100644
>>> index f1d2cbc5a..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
>>> +++ /dev/null
>>> @@ -1,31 +0,0 @@
>>> -From 078e962d345fd0536fe7ba797485ee1a4159c032 Mon Sep 17 00:00:00 2001
>>> -From: Khem Raj <raj.khem@gmail.com>
>>> -Date: Fri, 4 Feb 2022 09:18:30 -0800
>>> -Subject: [PATCH] Make alpha2 to be 3 characters long
>>> -
>>> -Fixes buffer overflow
>>> -reglib.c:969:9: error: 'sscanf' may overflow; destination buffer in argument 3 has size 2, but the corresponding specifier may require size 3 [-Werror,-Wfortify-source]
>>> -                      alpha2,
>>> -                      ^
>>> -Upstream-Status: Pending
>>> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> ----
>>> - reglib.c | 2 +-
>>> - 1 file changed, 1 insertion(+), 1 deletion(-)
>>> -
>>> -diff --git a/reglib.c b/reglib.c
>>> -index e00e9b8..8565a0b 100644
>>> ---- a/reglib.c
>>> -+++ b/reglib.c
>>> -@@ -958,7 +958,7 @@ reglib_parse_rules(FILE *fp, struct ieee80211_regdomain *trd)
>>> - static int reglib_parse_country_dfs(char *line, struct ieee80211_regdomain *rd)
>>> - {
>>> -     char dfs_region_alpha[9];
>>> --    char alpha2[2];
>>> -+    char alpha2[3];
>>> -     int hits;
>>> -
>>> -     memset(rd, 0, sizeof(*rd));
>>> ---
>>> -2.35.1
>>> -
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
>>> deleted file mode 100644
>>> index 16800d506..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
>>> +++ /dev/null
>>> @@ -1,29 +0,0 @@
>>> -From 1e1a78b7b4fa1662b4447aa19c15b1e839b7e9db Mon Sep 17 00:00:00 2001
>>> -From: =?UTF-8?q?Stefan=20M=C3=BCller-Klieser?= <s.mueller-klieser@phytec.de>
>>> -Date: Wed, 24 Aug 2016 10:58:45 +0200
>>> -Subject: [PATCH] Makefile: respect LDFLAGS for libreg
>>> -MIME-Version: 1.0
>>> -Content-Type: text/plain; charset=UTF-8
>>> -Content-Transfer-Encoding: 8bit
>>> -
>>> -Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
>>> ----
>>> - Makefile | 2 +-
>>> - 1 file changed, 1 insertion(+), 1 deletion(-)
>>> -
>>> -diff --git a/Makefile b/Makefile
>>> -index 2879896..1650db8 100644
>>> ---- a/Makefile
>>> -+++ b/Makefile
>>> -@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
>>> -
>>> - $(LIBREG): regdb.h reglib.h reglib.c
>>> -     $(NQ) '  CC  ' $@
>>> --    $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
>>> -+    $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
>>> -
>>> - install-libreg-headers:
>>> -     $(NQ) '  INSTALL  libreg-headers'
>>> ---
>>> -1.9.1
>>> -
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
>>> deleted file mode 100644
>>> index c6c3c53f1..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
>>> +++ /dev/null
>>> @@ -1,59 +0,0 @@
>>> -From 1bd6ff9d10c83afbc9954fc38b953e9167e6d4a9 Mon Sep 17 00:00:00 2001
>>> -From: Khem Raj <raj.khem@gmail.com>
>>> -Date: Sun, 28 Aug 2022 14:01:55 -0700
>>> -Subject: [PATCH] reglib: Remove unused variables
>>> -
>>> -These counters are not used anywhere therefore delete them
>>> -Fixes
>>> -reglib.c:1015:15: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
>>> -        unsigned int i = 0;
>>> -                     ^
>>> -reglib.c:1062:15: error: variable 'lines' set but not used [-Werror,-Wunused-but-set-variable]
>>> -        unsigned int lines = 0;
>>> -                     ^
>>> -
>>> -Upstream-Status: Pending
>>> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> ----
>>> - reglib.c | 4 ----
>>> - 1 file changed, 4 deletions(-)
>>> -
>>> -diff --git a/reglib.c b/reglib.c
>>> -index 8565a0b..6c62c2c 100644
>>> ---- a/reglib.c
>>> -+++ b/reglib.c
>>> -@@ -1012,7 +1012,6 @@ static int reglib_find_next_country_stream(FILE *fp)
>>> - {
>>> -     fpos_t prev_pos;
>>> -     int r;
>>> --    unsigned int i = 0;
>>> -
>>> -     while(1) {
>>> -             char line[1024];
>>> -@@ -1030,7 +1029,6 @@ static int reglib_find_next_country_stream(FILE *fp)
>>> -             line_p = fgets(line, sizeof(line), fp);
>>> -             if (line_p == line) {
>>> -                     if (strspn(line, "\n") == strlen(line)) {
>>> --                            i++;
>>> -                             continue;
>>> -                     }
>>> -                     if (strncmp(line, "country", 7) != 0)
>>> -@@ -1059,7 +1057,6 @@ struct ieee80211_regdomain *reglib_parse_country(FILE *fp)
>>> -
>>> - FILE *reglib_create_parse_stream(FILE *f)
>>> - {
>>> --    unsigned int lines = 0;
>>> -     FILE *fp;
>>> -
>>> -     fp = tmpfile();
>>> -@@ -1076,7 +1073,6 @@ FILE *reglib_create_parse_stream(FILE *f)
>>> -             if (line_p == line) {
>>> -                     if (strchr(line, '#') == NULL) {
>>> -                             fputs(line, fp);
>>> --                            lines++;
>>> -                     }
>>> -                     continue;
>>> -             } else
>>> ---
>>> -2.37.2
>>> -
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
>>> deleted file mode 100644
>>> index 9125d0ab9..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
>>> +++ /dev/null
>>> @@ -1,101 +0,0 @@
>>> -Imported from Gentoo
>>> -https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c50acec16bc7c33d6dc122c007d713e7fbecf9c
>>> -
>>> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> -
>>> ---- a/utils/key2pub.py
>>> -+++ b/utils/key2pub.py
>>> -@@ -1,22 +1,22 @@
>>> --#!/usr/bin/env python
>>> -+#!/usr/bin/env python3
>>> -
>>> - import sys
>>> - try:
>>> -        from M2Crypto import RSA
>>> --except ImportError, e:
>>> -+except ImportError as e:
>>> -        sys.stderr.write('ERROR: Failed to import the "M2Crypto" module: %s\n' % e.message)
>>> -        sys.stderr.write('Please install the "M2Crypto" Python module.\n')
>>> -        sys.stderr.write('On Debian GNU/Linux the package is called "python-m2crypto".\n')
>>> -        sys.exit(1)
>>> -
>>> - def print_ssl_64(output, name, val):
>>> --    while val[0] == '\0':
>>> -+    while val[0:1] == b'\0':
>>> -         val = val[1:]
>>> -     while len(val) % 8:
>>> --        val = '\0' + val
>>> -+        val = b'\0' + val
>>> -     vnew = []
>>> -     while len(val):
>>> --        vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]))
>>> -+        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4], val[4:5], val[5:6], val[6:7], val[7:8]))
>>> -         val = val[8:]
>>> -     vnew.reverse()
>>> -     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
>>> -@@ -34,13 +34,13 @@ def print_ssl_64(output, name, val):
>>> -     output.write('};\n\n')
>>> -
>>> - def print_ssl_32(output, name, val):
>>> --    while val[0] == '\0':
>>> -+    while val[0:1] == b'\0':
>>> -         val = val[1:]
>>> -     while len(val) % 4:
>>> --        val = '\0' + val
>>> -+        val = b'\0' + val
>>> -     vnew = []
>>> -     while len(val):
>>> --        vnew.append((val[0], val[1], val[2], val[3], ))
>>> -+        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4]))
>>> -         val = val[4:]
>>> -     vnew.reverse()
>>> -     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
>>> -@@ -81,21 +81,21 @@ struct pubkey {
>>> -
>>> - static struct pubkey keys[] __attribute__((unused))= {
>>> - ''')
>>> --    for n in xrange(n + 1):
>>> -+    for n in range(n + 1):
>>> -         output.write('      KEYS(e_%d, n_%d),\n' % (n, n))
>>> -     output.write('};\n')
>>> -     pass
>>> -
>>> - def print_gcrypt(output, name, val):
>>> -     output.write('#include <stdint.h>\n')
>>> --    while val[0] == '\0':
>>> -+    while val[0:1] == b'\0':
>>> -         val = val[1:]
>>> -     output.write('static const uint8_t %s[%d] = {\n' % (name, len(val)))
>>> -     idx = 0
>>> -     for v in val:
>>> -         if not idx:
>>> -             output.write('\t')
>>> --        output.write('0x%.2x, ' % ord(v))
>>> -+        output.write('0x%.2x, ' % (v if sys.version_info[0] >=3 else ord(v)))
>>> -         idx += 1
>>> -         if idx == 8:
>>> -             idx = 0
>>> -@@ -118,7 +118,7 @@ struct key_params {
>>> -
>>> - static const struct key_params keys[] __attribute__((unused))= {
>>> - ''')
>>> --    for n in xrange(n + 1):
>>> -+    for n in range(n + 1):
>>> -         output.write('      KEYS(e_%d, n_%d),\n' % (n, n))
>>> -     output.write('};\n')
>>> -
>>> -@@ -136,7 +136,7 @@ except IndexError:
>>> -     mode = None
>>> -
>>> - if not mode in modes:
>>> --    print 'Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys()))
>>> -+    print('Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys())))
>>> -     sys.exit(2)
>>> -
>>> - output = open(outfile, 'w')
>>> -@@ -154,3 +154,5 @@ for f in files:
>>> -     idx += 1
>>> -
>>> - modes[mode][1](output, idx - 1)
>>> -+
>>> -+output.close()
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
>>> deleted file mode 100644
>>> index 3ef35ee54..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
>>> +++ /dev/null
>>> @@ -1,21 +0,0 @@
>>> -From: Ben Hutchings <ben@decadent.org.uk>
>>> -Date: Sat, 23 Aug 2014 12:27:34 -0700
>>> -Subject: crda: Do not run ldconfig if DESTDIR is set
>>> -
>>> -Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126028.html]
>>> -
>>> -Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
>>> -Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
>>> -
>>> ---- a/Makefile
>>> -+++ b/Makefile
>>> -@@ -132,7 +132,9 @@ install-libreg:
>>> -     $(NQ) '  INSTALL  libreg'
>>> -     $(Q)mkdir -p $(DESTDIR)/$(LIBDIR)
>>> -     $(Q)cp $(LIBREG) $(DESTDIR)/$(LIBDIR)/
>>> -+ifndef DESTDIR
>>> -     $(Q)ldconfig
>>> -+endif
>>> -
>>> - %.o: %.c regdb.h $(LIBREG)
>>> -     $(NQ) '  CC  ' $@
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
>>> deleted file mode 100644
>>> index 747804d34..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
>>> +++ /dev/null
>>> @@ -1,11 +0,0 @@
>>> ---- crda-3.18/utils/key2pub.py.orig  2016-06-18 09:54:23.671326113 -0400
>>> -+++ crda-3.18/utils/key2pub.py       2016-06-18 09:54:34.387326300 -0400
>>> -@@ -115,7 +115,7 @@
>>> -     .n = _n, .len_n = sizeof(_n),   \
>>> - }
>>> -
>>> --static const struct key_params keys[] = {
>>> -+static const struct key_params keys[] __attribute__((unused))= {
>>> - ''')
>>> -     for n in xrange(n + 1):
>>> -         output.write('      KEYS(e_%d, n_%d),\n' % (n, n))
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
>>> deleted file mode 100644
>>> index 1bb5c638f..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
>>> +++ /dev/null
>>> @@ -1,58 +0,0 @@
>>> -From 8d2164a090f17286ea8291f30a123595cf447dc3 Mon Sep 17 00:00:00 2001
>>> -From: Haiqing Bai <Haiqing.Bai@windriver.com>
>>> -Date: Wed, 30 Nov 2016 10:27:36 +0800
>>> -Subject: [PATCH] crda: fix issues when 'USE_OPENSSL=1'.
>>> -
>>> -Fxed the below issues if configured with 'USE_OPENSSL=1':
>>> -a. keys-ssl.c uses BN_ULONG but doesn't include the openssl headers leading
>>> -   to build failures:
>>> -   keys-ssl.c:2:8: error: unknown type name 'BN_ULONG'
>>> -   static BN_ULONG e_0[1] = {
>>> -
>>> -b. The large unqualified constants also break building:
>>> -   keys-ssl.c:8:2: warning: overflow in implicit constant conversion [-Woverflow]
>>> -     0x63a2705416a0d8e1, 0xdc9fca11c8ba757b,
>>> -
>>> -c. keys-ssl.c: error: 'keys' defined but not used [-Werror=unused-variable]
>>> -   static struct pubkey keys[] = {
>>> -
>>> -Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>>> -Upstream-Status: Pending
>>> -Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
>>> ----
>>> - utils/key2pub.py | 5 +++--
>>> - 1 file changed, 3 insertions(+), 2 deletions(-)
>>> -
>>> -diff --git a/utils/key2pub.py b/utils/key2pub.py
>>> -index 401d58a..3ae00b8 100755
>>> ---- a/utils/key2pub.py
>>> -+++ b/utils/key2pub.py
>>> -@@ -24,7 +24,7 @@ def print_ssl_64(output, name, val):
>>> -     for v1, v2, v3, v4, v5, v6, v7, v8 in vnew:
>>> -         if not idx:
>>> -             output.write('\t')
>>> --        output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
>>> -+        output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2xULL, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
>>> -         idx += 1
>>> -         if idx == 2:
>>> -             idx = 0
>>> -@@ -60,6 +60,7 @@ def print_ssl_32(output, name, val):
>>> - def print_ssl(output, name, val):
>>> -     import os
>>> -     output.write('#include <stdint.h>\n')
>>> -+    output.write('#include <openssl/bn.h>\n')
>>> -     if os.getenv('TARGET_BITS') == '64':
>>> -         return print_ssl_64(output, name, val)
>>> -     else:
>>> -@@ -78,7 +79,7 @@ struct pubkey {
>>> -
>>> - #define KEYS(e,n)   { KEY(e), KEY(n), }
>>> -
>>> --static struct pubkey keys[] = {
>>> -+static struct pubkey keys[] __attribute__((unused))= {
>>> - ''')
>>> -     for n in xrange(n + 1):
>>> -         output.write('      KEYS(e_%d, n_%d),\n' % (n, n))
>>> ---
>>> -1.9.1
>>> -
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
>>> deleted file mode 100644
>>> index 812e98379..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
>>> +++ /dev/null
>>> @@ -1,57 +0,0 @@
>>> -From 890f5bf2654b695a866262d72bfa9750af921a3b Mon Sep 17 00:00:00 2001
>>> -From: Ben Hutchings <ben@decadent.org.uk>
>>> -Date: Sat, 23 Aug 2014 12:26:37 -0700
>>> -Subject: [PATCH] Fix linking of libraries used by libreg
>>> -
>>> -The math and crypto libraries are called by and need to be linked to
>>> -libreg.so, not to the executables.
>>> -
>>> -Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126027.html]
>>> -
>>> -Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
>>> -Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
>>> ----
>>> - Makefile | 8 ++++----
>>> - 1 file changed, 4 insertions(+), 4 deletions(-)
>>> -
>>> -diff --git a/Makefile b/Makefile
>>> -index a3ead30..da2dcc3 100644
>>> ---- a/Makefile
>>> -+++ b/Makefile
>>> -@@ -30,7 +30,7 @@ CFLAGS += -std=gnu99 -Wall -Werror -pedantic
>>> - CFLAGS += -Wall -g
>>> - LDLIBREG += -lreg
>>> - LDLIBS += $(LDLIBREG)
>>> --LDLIBS += -lm
>>> -+LIBREGLDLIBS += -lm
>>> - LIBREG += libreg.so
>>> - LDFLAGS += -L ./
>>> -
>>> -@@ -40,13 +40,13 @@ all_noverify: $(LIBREG) crda intersect regdbdump db2rd optimize
>>> -
>>> - ifeq ($(USE_OPENSSL),1)
>>> - CFLAGS += -DUSE_OPENSSL -DPUBKEY_DIR=\"$(RUNTIME_PUBKEY_DIR)\" `pkg-config --cflags openssl`
>>> --LDLIBS += `pkg-config --libs openssl`
>>> -+LIBREGLDLIBS += `pkg-config --libs openssl`
>>> -
>>> - $(LIBREG): keys-ssl.c
>>> -
>>> - else
>>> - CFLAGS += -DUSE_GCRYPT
>>> --LDLIBS += -lgcrypt
>>> -+LIBREGLDLIBS += -lgcrypt
>>> -
>>> - $(LIBREG): keys-gcrypt.c
>>> -
>>> -@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
>>> -
>>> - $(LIBREG): regdb.h reglib.h reglib.c
>>> -     $(NQ) '  CC  ' $@
>>> --    $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^
>>> -+    $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
>>> -
>>> - install-libreg-headers:
>>> -     $(NQ) '  INSTALL  libreg-headers'
>>> ---
>>> -2.7.4
>>> -
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
>>> deleted file mode 100644
>>> index 0b737852c..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
>>> +++ /dev/null
>>> @@ -1,25 +0,0 @@
>>> -These headers are not related to any Make rule but they do appear in
>>> -compiling of libreg.so, specifying .h files in compiler cmdline is flagged
>>> -as error by clang
>>> -
>>> -| clang-4.0: error: cannot specify -o when generating multiple output files
>>> -| make: *** [libreg.so] Error 1
>>> -
>>> -This is how we see headers in cmdline
>>> --O2 -fpic -std=gnu
>>> -99 -Wall -Werror -pedantic -Wall -g -DUSE_GCRYPT -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0`  -o libreg.so -shared -Wl,-soname,libreg.so
>>> -regdb.h reglib.h reglib.c keys-gcrypt.c -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -L ./ -lm -lgcrypt
>>> -
>>> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> -
>>> ---- a/Makefile.kk    2016-11-15 04:54:53.338670000 +0000
>>> -+++ a/Makefile       2016-11-15 04:55:07.718670000 +0000
>>> -@@ -114,7 +114,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(
>>> -     $(NQ) '  Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
>>> -     $(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
>>> -
>>> --$(LIBREG): regdb.h reglib.h reglib.c
>>> -+$(LIBREG): reglib.c
>>> -     $(NQ) '  CC  ' $@
>>> -     $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
>>> -
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
>>> deleted file mode 100644
>>> index 100b765f2..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
>>> +++ /dev/null
>>> @@ -1,34 +0,0 @@
>>> -From c1c42513edd27c97341f2033af77c13a4724eb8f Mon Sep 17 00:00:00 2001
>>> -From: Haiqing Bai <Haiqing.Bai@windriver.com>
>>> -Date: Fri, 25 Nov 2016 16:48:01 +0800
>>> -Subject: [PATCH] crda: Use target word size instead of host's.
>>> -
>>> -In key2pub.py, the codes check the wordsize
>>> -of the host machine but not the target's, this fix
>>> -fetches the wordsize of target from the build system.
>>> -
>>> -Upstream-Status: Pending
>>> -Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
>>> ----
>>> - utils/key2pub.py | 4 ++--
>>> - 1 file changed, 2 insertions(+), 2 deletions(-)
>>> -
>>> -diff --git a/utils/key2pub.py b/utils/key2pub.py
>>> -index 3e84cd2..401d58a 100755
>>> ---- a/utils/key2pub.py
>>> -+++ b/utils/key2pub.py
>>> -@@ -58,9 +58,9 @@ def print_ssl_32(output, name, val):
>>> -     output.write('};\n\n')
>>> -
>>> - def print_ssl(output, name, val):
>>> --    import struct
>>> -+    import os
>>> -     output.write('#include <stdint.h>\n')
>>> --    if len(struct.pack('@L', 0)) == 8:
>>> -+    if os.getenv('TARGET_BITS') == '64':
>>> -         return print_ssl_64(output, name, val)
>>> -     else:
>>> -         return print_ssl_32(output, name, val)
>>> ---
>>> -1.9.1
>>> -
>>> diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
>>> deleted file mode 100644
>>> index 2f4d4dac9..000000000
>>> --- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
>>> +++ /dev/null
>>> @@ -1,40 +0,0 @@
>>> -SUMMARY = "Wireless Central Regulatory Domain Agent"
>>> -HOMEPAGE = "http://wireless.kernel.org/en/developers/Regulatory/CRDA"
>>> -SECTION = "net"
>>> -LICENSE = "copyleft-next-0.3.0"
>>> -LIC_FILES_CHKSUM = "file://copyleft-next-0.3.0;md5=8743a2c359037d4d329a31e79eabeffe"
>>> -
>>> -DEPENDS = "python3-m2crypto-native libnl libgcrypt"
>>> -
>>> -SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz \
>>> -           file://do-not-run-ldconfig-if-destdir-is-set.patch \
>>> -           file://fix-linking-of-libraries-used-by-reglib.patch \
>>> -           file://fix-gcc-6-unused-variables.patch \
>>> -           file://0001-Makefile-respect-LDFLAGS-for-libreg.patch \
>>> -           file://make.patch \
>>> -           file://use-target-word-size-instead-of-host-s.patch \
>>> -           file://fix-issues-when-USE_OPENSSL-1.patch \
>>> -           file://crda-4.14-python-3.patch \
>>> -           file://0001-Make-alpha2-to-be-3-characters-long.patch \
>>> -           file://0001-reglib-Remove-unused-variables.patch \
>>> -"
>>> -SRC_URI[md5sum] = "0431fef3067bf503dfb464069f06163a"
>>> -SRC_URI[sha256sum] = "43fcb9679f8b75ed87ad10944a506292def13e4afb194afa7aa921b01e8ecdbf"
>>> -
>>> -inherit pkgconfig python3-dir python3native siteinfo
>>> -
>>> -# Recursive make problem
>>> -EXTRA_OEMAKE = "MAKEFLAGS= DESTDIR=${D} LIBDIR=${libdir}/crda LDLIBREG='-Wl,-rpath,${libdir}/crda -lreg' \
>>> -                UDEV_RULE_DIR=${nonarch_base_libdir}/udev/rules.d/"
>>> -TARGET_BITS = "${SITEINFO_BITS}"
>>> -export TARGET_BITS
>>> -
>>> -do_compile() {
>>> -    oe_runmake all_noverify
>>> -}
>>> -
>>> -do_install() {
>>> -    oe_runmake SBINDIR=${sbindir}/ install
>>> -}
>>> -
>>> -RDEPENDS:${PN} = "udev wireless-regdb"
>> --
>> # Randy MacLeod
>> # Wind River Linux
>>
diff mbox series

Patch

diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
deleted file mode 100644
index f1d2cbc5a..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Make-alpha2-to-be-3-characters-long.patch
+++ /dev/null
@@ -1,31 +0,0 @@ 
-From 078e962d345fd0536fe7ba797485ee1a4159c032 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 4 Feb 2022 09:18:30 -0800
-Subject: [PATCH] Make alpha2 to be 3 characters long
-
-Fixes buffer overflow
-reglib.c:969:9: error: 'sscanf' may overflow; destination buffer in argument 3 has size 2, but the corresponding specifier may require size 3 [-Werror,-Wfortify-source]
-                      alpha2,
-                      ^
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- reglib.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/reglib.c b/reglib.c
-index e00e9b8..8565a0b 100644
---- a/reglib.c
-+++ b/reglib.c
-@@ -958,7 +958,7 @@ reglib_parse_rules(FILE *fp, struct ieee80211_regdomain *trd)
- static int reglib_parse_country_dfs(char *line, struct ieee80211_regdomain *rd)
- {
- 	char dfs_region_alpha[9];
--	char alpha2[2];
-+	char alpha2[3];
- 	int hits;
- 
- 	memset(rd, 0, sizeof(*rd));
--- 
-2.35.1
-
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
deleted file mode 100644
index 16800d506..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
+++ /dev/null
@@ -1,29 +0,0 @@ 
-From 1e1a78b7b4fa1662b4447aa19c15b1e839b7e9db Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Stefan=20M=C3=BCller-Klieser?= <s.mueller-klieser@phytec.de>
-Date: Wed, 24 Aug 2016 10:58:45 +0200
-Subject: [PATCH] Makefile: respect LDFLAGS for libreg
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
----
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 2879896..1650db8 100644
---- a/Makefile
-+++ b/Makefile
-@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
- 
- $(LIBREG): regdb.h reglib.h reglib.c
- 	$(NQ) '  CC  ' $@
--	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
-+	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
- 
- install-libreg-headers:
- 	$(NQ) '  INSTALL  libreg-headers'
--- 
-1.9.1
-
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
deleted file mode 100644
index c6c3c53f1..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/0001-reglib-Remove-unused-variables.patch
+++ /dev/null
@@ -1,59 +0,0 @@ 
-From 1bd6ff9d10c83afbc9954fc38b953e9167e6d4a9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 28 Aug 2022 14:01:55 -0700
-Subject: [PATCH] reglib: Remove unused variables
-
-These counters are not used anywhere therefore delete them
-Fixes
-reglib.c:1015:15: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
-        unsigned int i = 0;
-                     ^
-reglib.c:1062:15: error: variable 'lines' set but not used [-Werror,-Wunused-but-set-variable]
-        unsigned int lines = 0;
-                     ^
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- reglib.c | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/reglib.c b/reglib.c
-index 8565a0b..6c62c2c 100644
---- a/reglib.c
-+++ b/reglib.c
-@@ -1012,7 +1012,6 @@ static int reglib_find_next_country_stream(FILE *fp)
- {
- 	fpos_t prev_pos;
- 	int r;
--	unsigned int i = 0;
- 
- 	while(1) {
- 		char line[1024];
-@@ -1030,7 +1029,6 @@ static int reglib_find_next_country_stream(FILE *fp)
- 		line_p = fgets(line, sizeof(line), fp);
- 		if (line_p == line) {
- 			if (strspn(line, "\n") == strlen(line)) {
--				i++;
- 				continue;
- 			}
- 			if (strncmp(line, "country", 7) != 0)
-@@ -1059,7 +1057,6 @@ struct ieee80211_regdomain *reglib_parse_country(FILE *fp)
- 
- FILE *reglib_create_parse_stream(FILE *f)
- {
--	unsigned int lines = 0;
- 	FILE *fp;
- 
- 	fp = tmpfile();
-@@ -1076,7 +1073,6 @@ FILE *reglib_create_parse_stream(FILE *f)
- 		if (line_p == line) {
- 			if (strchr(line, '#') == NULL) {
- 				fputs(line, fp);
--				lines++;
- 			}
- 			continue;
- 		} else
--- 
-2.37.2
-
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
deleted file mode 100644
index 9125d0ab9..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/crda-4.14-python-3.patch
+++ /dev/null
@@ -1,101 +0,0 @@ 
-Imported from Gentoo
-https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c50acec16bc7c33d6dc122c007d713e7fbecf9c
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
---- a/utils/key2pub.py
-+++ b/utils/key2pub.py
-@@ -1,22 +1,22 @@
--#!/usr/bin/env python
-+#!/usr/bin/env python3
- 
- import sys
- try:
-        from M2Crypto import RSA
--except ImportError, e:
-+except ImportError as e:
-        sys.stderr.write('ERROR: Failed to import the "M2Crypto" module: %s\n' % e.message)
-        sys.stderr.write('Please install the "M2Crypto" Python module.\n')
-        sys.stderr.write('On Debian GNU/Linux the package is called "python-m2crypto".\n')
-        sys.exit(1)
- 
- def print_ssl_64(output, name, val):
--    while val[0] == '\0':
-+    while val[0:1] == b'\0':
-         val = val[1:]
-     while len(val) % 8:
--        val = '\0' + val
-+        val = b'\0' + val
-     vnew = []
-     while len(val):
--        vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]))
-+        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4], val[4:5], val[5:6], val[6:7], val[7:8]))
-         val = val[8:]
-     vnew.reverse()
-     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
-@@ -34,13 +34,13 @@ def print_ssl_64(output, name, val):
-     output.write('};\n\n')
- 
- def print_ssl_32(output, name, val):
--    while val[0] == '\0':
-+    while val[0:1] == b'\0':
-         val = val[1:]
-     while len(val) % 4:
--        val = '\0' + val
-+        val = b'\0' + val
-     vnew = []
-     while len(val):
--        vnew.append((val[0], val[1], val[2], val[3], ))
-+        vnew.append((val[0:1], val[1:2], val[2:3], val[3:4]))
-         val = val[4:]
-     vnew.reverse()
-     output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
-@@ -81,21 +81,21 @@ struct pubkey {
- 
- static struct pubkey keys[] __attribute__((unused))= {
- ''')
--    for n in xrange(n + 1):
-+    for n in range(n + 1):
-         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
-     output.write('};\n')
-     pass
- 
- def print_gcrypt(output, name, val):
-     output.write('#include <stdint.h>\n')
--    while val[0] == '\0':
-+    while val[0:1] == b'\0':
-         val = val[1:]
-     output.write('static const uint8_t %s[%d] = {\n' % (name, len(val)))
-     idx = 0
-     for v in val:
-         if not idx:
-             output.write('\t')
--        output.write('0x%.2x, ' % ord(v))
-+        output.write('0x%.2x, ' % (v if sys.version_info[0] >=3 else ord(v)))
-         idx += 1
-         if idx == 8:
-             idx = 0
-@@ -118,7 +118,7 @@ struct key_params {
- 
- static const struct key_params keys[] __attribute__((unused))= {
- ''')
--    for n in xrange(n + 1):
-+    for n in range(n + 1):
-         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
-     output.write('};\n')
-     
-@@ -136,7 +136,7 @@ except IndexError:
-     mode = None
- 
- if not mode in modes:
--    print 'Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys()))
-+    print('Usage: %s [%s] input-file... output-file' % (sys.argv[0], '|'.join(modes.keys())))
-     sys.exit(2)
- 
- output = open(outfile, 'w')
-@@ -154,3 +154,5 @@ for f in files:
-     idx += 1
- 
- modes[mode][1](output, idx - 1)
-+
-+output.close()
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
deleted file mode 100644
index 3ef35ee54..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
+++ /dev/null
@@ -1,21 +0,0 @@ 
-From: Ben Hutchings <ben@decadent.org.uk>
-Date: Sat, 23 Aug 2014 12:27:34 -0700
-Subject: crda: Do not run ldconfig if DESTDIR is set
-
-Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126028.html]
-
-Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-
---- a/Makefile
-+++ b/Makefile
-@@ -132,7 +132,9 @@ install-libreg:
- 	$(NQ) '  INSTALL  libreg'
- 	$(Q)mkdir -p $(DESTDIR)/$(LIBDIR)
- 	$(Q)cp $(LIBREG) $(DESTDIR)/$(LIBDIR)/
-+ifndef DESTDIR
- 	$(Q)ldconfig
-+endif
- 
- %.o: %.c regdb.h $(LIBREG)
- 	$(NQ) '  CC  ' $@
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
deleted file mode 100644
index 747804d34..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
+++ /dev/null
@@ -1,11 +0,0 @@ 
---- crda-3.18/utils/key2pub.py.orig	2016-06-18 09:54:23.671326113 -0400
-+++ crda-3.18/utils/key2pub.py	2016-06-18 09:54:34.387326300 -0400
-@@ -115,7 +115,7 @@
- 	.n = _n, .len_n = sizeof(_n),	\
- }
- 
--static const struct key_params keys[] = {
-+static const struct key_params keys[] __attribute__((unused))= {
- ''')
-     for n in xrange(n + 1):
-         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
deleted file mode 100644
index 1bb5c638f..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
+++ /dev/null
@@ -1,58 +0,0 @@ 
-From 8d2164a090f17286ea8291f30a123595cf447dc3 Mon Sep 17 00:00:00 2001
-From: Haiqing Bai <Haiqing.Bai@windriver.com>
-Date: Wed, 30 Nov 2016 10:27:36 +0800
-Subject: [PATCH] crda: fix issues when 'USE_OPENSSL=1'.
-
-Fxed the below issues if configured with 'USE_OPENSSL=1':
-a. keys-ssl.c uses BN_ULONG but doesn't include the openssl headers leading
-   to build failures:
-   keys-ssl.c:2:8: error: unknown type name 'BN_ULONG'
-   static BN_ULONG e_0[1] = {
-
-b. The large unqualified constants also break building:
-   keys-ssl.c:8:2: warning: overflow in implicit constant conversion [-Woverflow]
-     0x63a2705416a0d8e1, 0xdc9fca11c8ba757b,
-
-c. keys-ssl.c: error: 'keys' defined but not used [-Werror=unused-variable]
-   static struct pubkey keys[] = {
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-Upstream-Status: Pending
-Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
----
- utils/key2pub.py | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/utils/key2pub.py b/utils/key2pub.py
-index 401d58a..3ae00b8 100755
---- a/utils/key2pub.py
-+++ b/utils/key2pub.py
-@@ -24,7 +24,7 @@ def print_ssl_64(output, name, val):
-     for v1, v2, v3, v4, v5, v6, v7, v8 in vnew:
-         if not idx:
-             output.write('\t')
--        output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
-+        output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2xULL, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
-         idx += 1
-         if idx == 2:
-             idx = 0
-@@ -60,6 +60,7 @@ def print_ssl_32(output, name, val):
- def print_ssl(output, name, val):
-     import os
-     output.write('#include <stdint.h>\n')
-+    output.write('#include <openssl/bn.h>\n')
-     if os.getenv('TARGET_BITS') == '64':
-         return print_ssl_64(output, name, val)
-     else:
-@@ -78,7 +79,7 @@ struct pubkey {
- 
- #define KEYS(e,n)	{ KEY(e), KEY(n), }
- 
--static struct pubkey keys[] = {
-+static struct pubkey keys[] __attribute__((unused))= {
- ''')
-     for n in xrange(n + 1):
-         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
--- 
-1.9.1
-
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
deleted file mode 100644
index 812e98379..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
+++ /dev/null
@@ -1,57 +0,0 @@ 
-From 890f5bf2654b695a866262d72bfa9750af921a3b Mon Sep 17 00:00:00 2001
-From: Ben Hutchings <ben@decadent.org.uk>
-Date: Sat, 23 Aug 2014 12:26:37 -0700
-Subject: [PATCH] Fix linking of libraries used by libreg
-
-The math and crypto libraries are called by and need to be linked to
-libreg.so, not to the executables.
-
-Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126027.html]
-
-Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
----
- Makefile | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index a3ead30..da2dcc3 100644
---- a/Makefile
-+++ b/Makefile
-@@ -30,7 +30,7 @@ CFLAGS += -std=gnu99 -Wall -Werror -pedantic
- CFLAGS += -Wall -g
- LDLIBREG += -lreg
- LDLIBS += $(LDLIBREG)
--LDLIBS += -lm
-+LIBREGLDLIBS += -lm
- LIBREG += libreg.so
- LDFLAGS += -L ./
- 
-@@ -40,13 +40,13 @@ all_noverify: $(LIBREG) crda intersect regdbdump db2rd optimize
- 
- ifeq ($(USE_OPENSSL),1)
- CFLAGS += -DUSE_OPENSSL -DPUBKEY_DIR=\"$(RUNTIME_PUBKEY_DIR)\" `pkg-config --cflags openssl`
--LDLIBS += `pkg-config --libs openssl`
-+LIBREGLDLIBS += `pkg-config --libs openssl`
- 
- $(LIBREG): keys-ssl.c
- 
- else
- CFLAGS += -DUSE_GCRYPT
--LDLIBS += -lgcrypt
-+LIBREGLDLIBS += -lgcrypt
- 
- $(LIBREG): keys-gcrypt.c
- 
-@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
- 
- $(LIBREG): regdb.h reglib.h reglib.c
- 	$(NQ) '  CC  ' $@
--	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^
-+	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
- 
- install-libreg-headers:
- 	$(NQ) '  INSTALL  libreg-headers'
--- 
-2.7.4
-
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
deleted file mode 100644
index 0b737852c..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/make.patch
+++ /dev/null
@@ -1,25 +0,0 @@ 
-These headers are not related to any Make rule but they do appear in
-compiling of libreg.so, specifying .h files in compiler cmdline is flagged
-as error by clang
-
-| clang-4.0: error: cannot specify -o when generating multiple output files
-| make: *** [libreg.so] Error 1
-
-This is how we see headers in cmdline
--O2 -fpic -std=gnu
-99 -Wall -Werror -pedantic -Wall -g -DUSE_GCRYPT -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0`  -o libreg.so -shared -Wl,-soname,libreg.so
-regdb.h reglib.h reglib.c keys-gcrypt.c -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -L ./ -lm -lgcrypt
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
---- a/Makefile.kk	2016-11-15 04:54:53.338670000 +0000
-+++ a/Makefile	2016-11-15 04:55:07.718670000 +0000
-@@ -114,7 +114,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(
- 	$(NQ) '  Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
- 	$(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
- 
--$(LIBREG): regdb.h reglib.h reglib.c
-+$(LIBREG): reglib.c
- 	$(NQ) '  CC  ' $@
- 	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
- 
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
deleted file mode 100644
index 100b765f2..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
+++ /dev/null
@@ -1,34 +0,0 @@ 
-From c1c42513edd27c97341f2033af77c13a4724eb8f Mon Sep 17 00:00:00 2001
-From: Haiqing Bai <Haiqing.Bai@windriver.com>
-Date: Fri, 25 Nov 2016 16:48:01 +0800
-Subject: [PATCH] crda: Use target word size instead of host's.
-
-In key2pub.py, the codes check the wordsize
-of the host machine but not the target's, this fix
-fetches the wordsize of target from the build system.
-
-Upstream-Status: Pending
-Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
----
- utils/key2pub.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/utils/key2pub.py b/utils/key2pub.py
-index 3e84cd2..401d58a 100755
---- a/utils/key2pub.py
-+++ b/utils/key2pub.py
-@@ -58,9 +58,9 @@ def print_ssl_32(output, name, val):
-     output.write('};\n\n')
- 
- def print_ssl(output, name, val):
--    import struct
-+    import os
-     output.write('#include <stdint.h>\n')
--    if len(struct.pack('@L', 0)) == 8:
-+    if os.getenv('TARGET_BITS') == '64':
-         return print_ssl_64(output, name, val)
-     else:
-         return print_ssl_32(output, name, val)
--- 
-1.9.1
-
diff --git a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb b/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
deleted file mode 100644
index 2f4d4dac9..000000000
--- a/meta-networking/dynamic-layers/meta-python/recipes-connectivity/crda/crda_3.18.bb
+++ /dev/null
@@ -1,40 +0,0 @@ 
-SUMMARY = "Wireless Central Regulatory Domain Agent"
-HOMEPAGE = "http://wireless.kernel.org/en/developers/Regulatory/CRDA"
-SECTION = "net"
-LICENSE = "copyleft-next-0.3.0"
-LIC_FILES_CHKSUM = "file://copyleft-next-0.3.0;md5=8743a2c359037d4d329a31e79eabeffe"
-
-DEPENDS = "python3-m2crypto-native libnl libgcrypt"
-
-SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz \
-           file://do-not-run-ldconfig-if-destdir-is-set.patch \
-           file://fix-linking-of-libraries-used-by-reglib.patch \
-           file://fix-gcc-6-unused-variables.patch \
-           file://0001-Makefile-respect-LDFLAGS-for-libreg.patch \
-           file://make.patch \
-           file://use-target-word-size-instead-of-host-s.patch \
-           file://fix-issues-when-USE_OPENSSL-1.patch \
-           file://crda-4.14-python-3.patch \
-           file://0001-Make-alpha2-to-be-3-characters-long.patch \
-           file://0001-reglib-Remove-unused-variables.patch \
-"
-SRC_URI[md5sum] = "0431fef3067bf503dfb464069f06163a"
-SRC_URI[sha256sum] = "43fcb9679f8b75ed87ad10944a506292def13e4afb194afa7aa921b01e8ecdbf"
-
-inherit pkgconfig python3-dir python3native siteinfo
-
-# Recursive make problem
-EXTRA_OEMAKE = "MAKEFLAGS= DESTDIR=${D} LIBDIR=${libdir}/crda LDLIBREG='-Wl,-rpath,${libdir}/crda -lreg' \
-                UDEV_RULE_DIR=${nonarch_base_libdir}/udev/rules.d/"
-TARGET_BITS = "${SITEINFO_BITS}"
-export TARGET_BITS
-
-do_compile() {
-    oe_runmake all_noverify
-}
-
-do_install() {
-    oe_runmake SBINDIR=${sbindir}/ install
-}
-
-RDEPENDS:${PN} = "udev wireless-regdb"