summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2018-07-04 15:31:25 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2018-07-05 09:07:25 +0200
commit877db348066d80549eca9eb364c47343ecad4fc8 (patch)
treec3c5f8daa5839461e7480f2a3700291182799716
parent34a07577a8ddd28d87be1ddf4b3f602e5e7fae93 (diff)
downloadptxdist-877db348066d80549eca9eb364c47343ecad4fc8.tar.gz
ptxdist-877db348066d80549eca9eb364c47343ecad4fc8.tar.xz
crda: extend rule to download versioned regulatory.binptxdist-2018.07.0
The crda reads the regulatory database information from regulatory.bin, which is updated upon regulatory changes and is versioned. Extend the crda.make to download a specified version of the database to document the used database version. This allows to drop the copy of the regulatory.bin from the projectroot. Still allow to override the database in a BSP projectroot if necessary. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> [mol: simplify install stage] Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--projectroot/usr/lib/crda/regulatory.binbin4968 -> 0 bytes
-rw-r--r--rules/crda.make39
2 files changed, 37 insertions, 2 deletions
diff --git a/projectroot/usr/lib/crda/regulatory.bin b/projectroot/usr/lib/crda/regulatory.bin
deleted file mode 100644
index 4f466e8ae..000000000
--- a/projectroot/usr/lib/crda/regulatory.bin
+++ /dev/null
Binary files differ
diff --git a/rules/crda.make b/rules/crda.make
index 89e69da64..46e9f7fa0 100644
--- a/rules/crda.make
+++ b/rules/crda.make
@@ -22,12 +22,38 @@ CRDA := crda-$(CRDA_VERSION)
CRDA_SUFFIX := tar.xz
CRDA_URL := $(call ptx/mirror, KERNEL, ../software/network/crda/$(CRDA).$(CRDA_SUFFIX))
CRDA_SOURCE := $(SRCDIR)/$(CRDA).$(CRDA_SUFFIX)
+$(CRDA_SOURCE) := CRDA_SOURCE
CRDA_DIR := $(BUILDDIR)/$(CRDA)
CRDA_LICENSE := ISC AND copyleft-next-0.3.0
CRDA_LICENSE_FILES := \
file://LICENSE;md5=ef8b69b43141352d821fd66b64ff0ee7 \
file://copyleft-next-0.3.0;md5=8743a2c359037d4d329a31e79eabeffe
+CRDA_REGDB_VERSION := 2018.05.31
+CRDA_REGDB_MD5 := 69bee8391dd0f2a1d23182e8a75f64c5
+CRDA_REGDB := wireless-regdb-$(CRDA_REGDB_VERSION)
+CRDA_REGDB_SUFFIX := tar.gz
+CRDA_REGDB_URL := \
+ https://www.kernel.org/pub/software/network/wireless-regdb/$(CRDA_REGDB).$(CRDA_REGDB_SUFFIX)
+CRDA_REGDB_SOURCE := $(SRCDIR)/$(CRDA_REGDB).$(CRDA_REGDB_SUFFIX)
+$(CRDA_REGDB_SOURCE) := CRDA_REGDB
+CRDA_REGDB_DIR := $(CRDA_DIR)
+CRDA_REGDB_STRIP_LEVEL := 0
+
+CRDA_SOURCES += $(CRDA_REGDB_SOURCE)
+
+# ----------------------------------------------------------------------------
+# Extract
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/crda.extract:
+ @$(call targetinfo)
+ @$(call clean, $(CRDA_DIR))
+ @$(call extract, CRDA)
+ @$(call extract, CRDA_REGDB)
+ @$(call patchin, CRDA)
+ @$(call touch)
+
# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------
@@ -55,6 +81,17 @@ CRDA_MAKE_ENV := \
CRDA_MAKE_OPT := all_noverify
# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/crda.install:
+ @$(call targetinfo)
+ @$(call world/install, CRDA)
+ @install -vD -m 644 $(CRDA_REGDB_DIR)/$(CRDA_REGDB)/regulatory.bin \
+ $(CRDA_PKGDIR)/usr/lib/crda/regulatory.bin
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------
@@ -73,8 +110,6 @@ $(STATEDIR)/crda.targetinstall:
/usr/lib/udev/rules.d/85-regulatory.rules)
@$(call install_lib, crda, 0, 0, 0644, libreg)
- # regulatory.bin was downloaded from:
- # https://git.kernel.org/cgit/linux/kernel/git/sforshee/wireless-regdb.git/plain/regulatory.bin
@$(call install_alternative, crda, 0, 0, 0644, \
/usr/lib/crda/regulatory.bin)