Patchwork [v2] crda: new package

login
register
mail settings
Submitter Dimitrios Siganos
Date Feb. 19, 2013, 12:46 p.m.
Message ID <5123740E.6040203@siganos.org>
Download mbox | patch
Permalink /patch/221693/
State Changes Requested
Headers show

Comments

Dimitrios Siganos - Feb. 19, 2013, 12:46 p.m.
Improved patch that supersedes the previous one I sent. In this one,
manpages are removed only if BR2_HAVE_DOCUMENTATION != y.
Baruch Siach - Feb. 28, 2013, 5:54 a.m.
Hi Dimitrios,

On Tue, Feb 19, 2013 at 12:46:06PM +0000, Dimitrios Siganos wrote:
> From 23f7a55f8c06a098c8d6bc8f56021f9954159419 Mon Sep 17 00:00:00 2001
> From: Dimitrios Siganos <dimitris@siganos.org>
> Date: Fri, 15 Feb 2013 11:52:25 +0000
> Subject: [PATCH 02/11] crda: new package
> 
> 
> Signed-off-by: Dimitrios Siganos <dimitris@siganos.org>
> ---
>  package/Config.in          |    1 +
>  package/crda/Config.in     |   12 ++++++++++
>  package/crda/crda.mk       |   32 ++++++++++++++++++++++++++
>  package/crda/keys-gcrypt.c |   53 ++++++++++++++++++++++++++++++++++++++++++++
>  package/crda/keys-ssl.c    |   38 +++++++++++++++++++++++++++++++

Please explain what these two .c files are, and why they are needed. Adding 
them as patches may be preferable, since you won't have to copy them 
explicitly.

[...]

> +CRDA_DEPENDENCIES = host-pkgconf libnl libgcrypt wireless-regdb

You need to add a 'select' for libnl, libgcrypt, and wireless-regdb in your 
Config.in.

> +CRDA_LICENSE := ISC
> +CRDA_LICENSE_FILES := LICENSE

Please use '=' only.

baruch

Patch

From 23f7a55f8c06a098c8d6bc8f56021f9954159419 Mon Sep 17 00:00:00 2001
From: Dimitrios Siganos <dimitris@siganos.org>
Date: Fri, 15 Feb 2013 11:52:25 +0000
Subject: [PATCH 02/11] crda: new package


Signed-off-by: Dimitrios Siganos <dimitris@siganos.org>
---
 package/Config.in          |    1 +
 package/crda/Config.in     |   12 ++++++++++
 package/crda/crda.mk       |   32 ++++++++++++++++++++++++++
 package/crda/keys-gcrypt.c |   53 ++++++++++++++++++++++++++++++++++++++++++++
 package/crda/keys-ssl.c    |   38 +++++++++++++++++++++++++++++++
 5 files changed, 136 insertions(+)
 create mode 100644 package/crda/Config.in
 create mode 100644 package/crda/crda.mk
 create mode 100644 package/crda/keys-gcrypt.c
 create mode 100644 package/crda/keys-ssl.c

diff --git a/package/Config.in b/package/Config.in
index e592c05..5fc1d4b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -622,6 +622,7 @@  source "package/bmon/Config.in"
 source "package/bridge-utils/Config.in"
 source "package/can-utils/Config.in"
 source "package/connman/Config.in"
+source "package/crda/Config.in"
 source "package/ctorrent/Config.in"
 source "package/conntrack-tools/Config.in"
 source "package/cups/Config.in"
diff --git a/package/crda/Config.in b/package/crda/Config.in
new file mode 100644
index 0000000..231fa27
--- /dev/null
+++ b/package/crda/Config.in
@@ -0,0 +1,12 @@ 
+config BR2_PACKAGE_CRDA
+	bool "crda"
+	help
+	  Central Regulatory Domain Agent.
+
+	  This package provides a Central Regulatory Domain Agent (CRDA)
+	  to be used by the Linux kernel cf80211 wireless subsystem to
+	  query and apply the regulatory domain settings wireless devices
+	  may operate within for a given location. 
+
+	  http://linuxwireless.org/en/developers/Regulatory/CRDA
+
diff --git a/package/crda/crda.mk b/package/crda/crda.mk
new file mode 100644
index 0000000..cb27967
--- /dev/null
+++ b/package/crda/crda.mk
@@ -0,0 +1,32 @@ 
+#############################################################
+#
+# crda
+#
+#############################################################
+
+CRDA_VERSION = 1.1.3
+CRDA_SOURCE = crda-$(CRDA_VERSION).tar.bz2
+CRDA_SITE = http://wireless.kernel.org/download/crda
+CRDA_DEPENDENCIES = host-pkgconf libnl libgcrypt wireless-regdb
+CRDA_LICENSE := ISC
+CRDA_LICENSE_FILES := LICENSE
+
+define CRDA_BUILD_CMDS
+    rsync package/crda/keys-gcrypt.c package/crda/keys-ssl.c $(@D)
+    $(TARGET_CONFIGURE_OPTS) $(MAKE) all_noverify -C $(@D)
+endef
+
+define CRDA_INSTALL_TARGET_CMDS
+    $(TARGET_CONFIGURE_OPTS) $(MAKE) install -C $(@D) DESTDIR=$(TARGET_DIR)
+endef
+
+define CRDA_REMOVE_DOCS
+    rm -f $(TARGET_DIR)/usr/share/man/man8/crda.8.gz
+    rm -f $(TARGET_DIR)/usr/share/man/man8/regdbdump.8.gz
+endef
+
+ifneq ($(BR2_HAVE_DOCUMENTATION),y)
+CRDA_POST_INSTALL_TARGET_HOOKS += CRDA_REMOVE_DOCS
+endif
+
+$(eval $(generic-package))
diff --git a/package/crda/keys-gcrypt.c b/package/crda/keys-gcrypt.c
new file mode 100644
index 0000000..e01d3ac
--- /dev/null
+++ b/package/crda/keys-gcrypt.c
@@ -0,0 +1,53 @@ 
+static const uint8_t e_0[3] = {
+	0x01, 0x00, 0x01, 
+};
+
+static const uint8_t n_0[256] = {
+	0xd6, 0x57, 0x99, 0x71, 0x88, 0xd3, 0x5d, 0xce, 
+	0x2a, 0x2e, 0xad, 0x68, 0x37, 0x60, 0x24, 0xf2, 
+	0xf2, 0xcf, 0xf3, 0x93, 0xf9, 0x70, 0x54, 0xeb, 
+	0x0a, 0x9a, 0x9d, 0x48, 0x8e, 0x56, 0xe1, 0x53, 
+	0xb0, 0x75, 0xa2, 0x41, 0xe1, 0x3b, 0x5a, 0xc5, 
+	0x4d, 0x9f, 0x01, 0x37, 0x07, 0xfc, 0x0d, 0x84, 
+	0xb0, 0x4d, 0xe1, 0xd6, 0xb3, 0x9f, 0xcc, 0x8d, 
+	0x3e, 0x7c, 0x15, 0x7d, 0x0d, 0xc3, 0x8e, 0xab, 
+	0x22, 0x03, 0xfb, 0x37, 0x48, 0x2c, 0x13, 0x1b, 
+	0xf3, 0x12, 0xb9, 0x66, 0xff, 0xbb, 0xf0, 0xe9, 
+	0x01, 0x1a, 0x5b, 0x3f, 0x5b, 0x3b, 0xc3, 0x0d, 
+	0x58, 0x5d, 0x9a, 0x7d, 0x53, 0x44, 0x7b, 0xd1, 
+	0xbe, 0x62, 0x72, 0xed, 0xc5, 0xf5, 0x98, 0x24, 
+	0xf9, 0xe9, 0xc9, 0xc7, 0xad, 0x93, 0x3f, 0x64, 
+	0x16, 0x85, 0xc1, 0x57, 0xe2, 0x0f, 0xd4, 0xdc, 
+	0xaa, 0xa8, 0xac, 0xc8, 0x5d, 0x6c, 0xa8, 0x4e, 
+	0x7e, 0x70, 0xc1, 0xd3, 0x59, 0x16, 0xf1, 0x73, 
+	0x5f, 0xab, 0xb6, 0x88, 0xeb, 0xd1, 0xe1, 0x98, 
+	0xac, 0xd7, 0xca, 0xdb, 0x46, 0xb0, 0x94, 0x3e, 
+	0x4a, 0x56, 0x3e, 0x84, 0x8f, 0x3a, 0x2d, 0xaf, 
+	0xd1, 0x03, 0x58, 0x0b, 0x0b, 0xd5, 0xb1, 0xff, 
+	0x90, 0x67, 0xcc, 0x76, 0x7a, 0x6e, 0xb5, 0xcc, 
+	0x8c, 0x6a, 0x92, 0xd0, 0xa5, 0x15, 0x6b, 0xb8, 
+	0xef, 0xe3, 0x11, 0xd8, 0xd2, 0x9a, 0x10, 0x04, 
+	0xfe, 0xc8, 0xf5, 0xb6, 0x61, 0xdc, 0x01, 0x70, 
+	0x53, 0xea, 0x3e, 0x5a, 0x97, 0x83, 0x9a, 0x2e, 
+	0x20, 0x5a, 0x5a, 0x73, 0xfe, 0xfa, 0xbb, 0xa7, 
+	0x7b, 0xba, 0xe3, 0x8a, 0x6c, 0x1f, 0xce, 0x9d, 
+	0x39, 0xe3, 0xdf, 0xeb, 0xba, 0x94, 0x14, 0x33, 
+	0xb9, 0xc0, 0x65, 0x10, 0xcb, 0xcb, 0x35, 0xe3, 
+	0xdc, 0x9f, 0xca, 0x11, 0xc8, 0xba, 0x75, 0x7b, 
+	0x63, 0xa2, 0x70, 0x54, 0x16, 0xa0, 0xd8, 0xe1, 
+};
+
+
+struct key_params {
+	const uint8_t *e, *n;
+	uint32_t len_e, len_n;
+};
+
+#define KEYS(_e, _n) {			\
+	.e = _e, .len_e = sizeof(_e),	\
+	.n = _n, .len_n = sizeof(_n),	\
+}
+
+static const struct key_params keys[] = {
+	KEYS(e_0, n_0),
+};
diff --git a/package/crda/keys-ssl.c b/package/crda/keys-ssl.c
new file mode 100644
index 0000000..8086bab
--- /dev/null
+++ b/package/crda/keys-ssl.c
@@ -0,0 +1,38 @@ 
+static BN_ULONG e_0[1] = {
+	0x0000000000010001, 
+};
+
+static BN_ULONG n_0[32] = {
+	0x63a2705416a0d8e1, 0xdc9fca11c8ba757b, 
+	0xb9c06510cbcb35e3, 0x39e3dfebba941433, 
+	0x7bbae38a6c1fce9d, 0x205a5a73fefabba7, 
+	0x53ea3e5a97839a2e, 0xfec8f5b661dc0170, 
+	0xefe311d8d29a1004, 0x8c6a92d0a5156bb8, 
+	0x9067cc767a6eb5cc, 0xd103580b0bd5b1ff, 
+	0x4a563e848f3a2daf, 0xacd7cadb46b0943e, 
+	0x5fabb688ebd1e198, 0x7e70c1d35916f173, 
+	0xaaa8acc85d6ca84e, 0x1685c157e20fd4dc, 
+	0xf9e9c9c7ad933f64, 0xbe6272edc5f59824, 
+	0x585d9a7d53447bd1, 0x011a5b3f5b3bc30d, 
+	0xf312b966ffbbf0e9, 0x2203fb37482c131b, 
+	0x3e7c157d0dc38eab, 0xb04de1d6b39fcc8d, 
+	0x4d9f013707fc0d84, 0xb075a241e13b5ac5, 
+	0x0a9a9d488e56e153, 0xf2cff393f97054eb, 
+	0x2a2ead68376024f2, 0xd657997188d35dce, 
+};
+
+
+struct pubkey {
+	struct bignum_st e, n;
+};
+
+#define KEY(data) {				\
+	.d = data,				\
+	.top = sizeof(data)/sizeof(data[0]),	\
+}
+
+#define KEYS(e,n)	{ KEY(e), KEY(n), }
+
+static struct pubkey keys[] = {
+	KEYS(e_0, n_0),
+};
-- 
1.7.9.5