aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-01-28 20:03:04 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-01-28 20:03:04 +0000
commit11456c324d3e2e5bb3b113fc94d94f93952f8d42 (patch)
treeeba60c48998242ea34d1ad8d6347a5de18b46a8e
parentec34d908c7f9277807249c07ab0de5a267683c6e (diff)
downloadupstream-11456c324d3e2e5bb3b113fc94d94f93952f8d42.tar.gz
upstream-11456c324d3e2e5bb3b113fc94d94f93952f8d42.tar.bz2
upstream-11456c324d3e2e5bb3b113fc94d94f93952f8d42.zip
crda: new package (thanks to Hauke Mehrtens <hauke@hauke-m.de>)
SVN-Revision: 14249
-rw-r--r--package/crda/Makefile73
-rw-r--r--package/crda/files/hotplug.rule6
-rw-r--r--package/crda/patches/100-remove_key_generation.patch58
3 files changed, 137 insertions, 0 deletions
diff --git a/package/crda/Makefile b/package/crda/Makefile
new file mode 100644
index 0000000000..aa58524ec2
--- /dev/null
+++ b/package/crda/Makefile
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id$
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=crda
+PKG_RELEASE:=1
+PKG_VERSION:=1.0.1
+PKG_SOURCE_URL:=http://wireless.kernel.org/download/crda
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MD5SUM:=03554b71eef2626795befa17eb1d8b9e
+PKG_BUILD_DEPENDS:=mac80211 libnl openssl
+
+PKG_REGULATORY_NAME:=regulatory
+PKG_REGULATORY_VERSION:=2009.01.15
+PKG_REGULATORY_SOURCE_URL:=http://wireless.kernel.org/download/wireless-regdb/regulatory.bins
+PKG_REGULATORY_SOURCE:=$(PKG_REGULATORY_VERSION)-$(PKG_REGULATORY_NAME).bin
+PKG_REGULATORY_MD5SUM:=a0db99e5385c876b6da7e2869546f6e2
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/crda
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Central Regulatory Domain Agent (CRDA)
+ DEPENDS:=@LINUX_2_6 +hotplug2 +kmod-mac80211
+ URL:=http://wireless.kernel.org/en/developers/Regulatory/CRDA
+endef
+
+define Download/wireless-regdb
+ FILE:=$(PKG_REGULATORY_SOURCE)
+ URL:=$(PKG_REGULATORY_SOURCE_URL)
+ VERSION:=$(PKG_REGULATORY_VERSION)
+ MD5SUM:=$(PKG_REGULATORY_MD5SUM)
+endef
+$(eval $(call Download,wireless-regdb))
+
+define Package/crda/description
+ This is the Central Regulatory Domain Agent for Linux. It serves one
+ purpose: tell Linux kernel what to enforce. In essence it is a udev
+ helper for communication between the kernel and userspace. You only
+ need to run this manually for debugging purposes. For manual changing
+ of regulatory domains use iw (iw reg set) or wpa_supplicant (feature
+ yet to be added).
+endef
+
+define Build/Compile
+ $(MAKE_VARS) \
+ $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
+ $(MAKE_FLAGS) \
+ USE_OPENSSL=1 \
+ REG_BIN="$(DL_DIR)/$(PKG_REGULATORY_SOURCE)" \
+ $(1)
+endef
+
+define Package/crda/install
+ $(INSTALL_DIR) $(1)/sbin
+ $(INSTALL_DIR) $(1)/etc/hotplug.d
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/platform
+ $(INSTALL_DIR) $(1)/usr/lib/crda
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/crda $(1)/sbin/
+ $(INSTALL_DATA) ./files/hotplug.rule $(1)/etc/hotplug.d/platform/10-regulatory
+ $(INSTALL_DATA) $(DL_DIR)/$(PKG_REGULATORY_SOURCE) $(1)/usr/lib/crda/regulatory.bin
+endef
+
+$(eval $(call BuildPackage,crda))
+
diff --git a/package/crda/files/hotplug.rule b/package/crda/files/hotplug.rule
new file mode 100644
index 0000000000..1ec033f46a
--- /dev/null
+++ b/package/crda/files/hotplug.rule
@@ -0,0 +1,6 @@
+#!/bin/sh
+# Copyright (C) 2009 OpenWrt.org
+
+[ change = "$ACTION" -a regulatory.0 = "$DEVICENAME" ] && {
+ /sbin/crda
+}
diff --git a/package/crda/patches/100-remove_key_generation.patch b/package/crda/patches/100-remove_key_generation.patch
new file mode 100644
index 0000000000..f89c6343c9
--- /dev/null
+++ b/package/crda/patches/100-remove_key_generation.patch
@@ -0,0 +1,58 @@
+Normally the keys-ssl.c will be auto generated in utils/key2pub.py, but for that the python-m2crypto package must be installed.
+To not add an other dependencies to the buildroot this patch adds the result.
+If the key in pubkeys/linville.key.pub.pem changes this patch has to be changed with the new keys-ssl.c included.
+
+--- a/keys-ssl.c 1970-01-01 01:00:00.000000000 +0100
++++ b/keys-ssl.c 2009-01-20 22:35:10.000000000 +0100
+@@ -0,0 +1,38 @@
++static BN_ULONG e_0[1] = {
++ 0x00010001,
++};
++
++static BN_ULONG n_0[64] = {
++ 0x16a0d8e1, 0x63a27054, 0xc8ba757b, 0xdc9fca11,
++ 0xcbcb35e3, 0xb9c06510, 0xba941433, 0x39e3dfeb,
++ 0x6c1fce9d, 0x7bbae38a, 0xfefabba7, 0x205a5a73,
++ 0x97839a2e, 0x53ea3e5a, 0x61dc0170, 0xfec8f5b6,
++ 0xd29a1004, 0xefe311d8, 0xa5156bb8, 0x8c6a92d0,
++ 0x7a6eb5cc, 0x9067cc76, 0x0bd5b1ff, 0xd103580b,
++ 0x8f3a2daf, 0x4a563e84, 0x46b0943e, 0xacd7cadb,
++ 0xebd1e198, 0x5fabb688, 0x5916f173, 0x7e70c1d3,
++ 0x5d6ca84e, 0xaaa8acc8, 0xe20fd4dc, 0x1685c157,
++ 0xad933f64, 0xf9e9c9c7, 0xc5f59824, 0xbe6272ed,
++ 0x53447bd1, 0x585d9a7d, 0x5b3bc30d, 0x011a5b3f,
++ 0xffbbf0e9, 0xf312b966, 0x482c131b, 0x2203fb37,
++ 0x0dc38eab, 0x3e7c157d, 0xb39fcc8d, 0xb04de1d6,
++ 0x07fc0d84, 0x4d9f0137, 0xe13b5ac5, 0xb075a241,
++ 0x8e56e153, 0x0a9a9d48, 0xf97054eb, 0xf2cff393,
++ 0x376024f2, 0x2a2ead68, 0x88d35dce, 0xd6579971,
++};
++
++
++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),
++};
+--- a/Makefile 2009-01-20 22:38:48.000000000 +0100
++++ b/Makefile 2009-01-20 22:38:56.000000000 +0100
+@@ -75,10 +75,6 @@
+ $(NQ)
+ $(Q) exit 1
+
+-keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
+- $(NQ) ' GEN ' $@
+- $(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
+-
+ %.o: %.c regdb.h
+ $(NQ) ' CC ' $@
+ $(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<