mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] crda: extend rule to download versioned regulatory.bin
@ 2018-07-04 13:31 Michael Tretter
  0 siblings, 0 replies; only message in thread
From: Michael Tretter @ 2018-07-04 13:31 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Tretter

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>
---
 projectroot/usr/lib/crda/regulatory.bin | Bin 4968 -> 0 bytes
 rules/crda.make                         |  40 ++++++++++++++++++++++--
 2 files changed, 38 insertions(+), 2 deletions(-)
 delete mode 100644 projectroot/usr/lib/crda/regulatory.bin

diff --git a/projectroot/usr/lib/crda/regulatory.bin b/projectroot/usr/lib/crda/regulatory.bin
deleted file mode 100644
index 4f466e8ae1670c8ce779d83404955446f044e5fa..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 4968
zcmZ`+YiwLs5kC8{_wL@CV1$9R31~q!by0p;B$P;T8}Gy3b@q|X?)9?<Ofis#RU6tZ
zjlh6gtP;``1rd-*U5KiZ7!-<uP%Shd7r9bEhFT(`{$aI_>NJV!sv9ZLKoZI~bLQM^
zBDm7o`R<&VZ@!sxt|b>!$+%MLJxV#3VV_mX2SZP2L0h}3ZRCKq?>eGw<1^ZZN3^xB
zYTK|^-mhsJIInHU($@S&_G{GekhacQZ6h^p-`%cl)4Xaqx}aKLEhshBsrnxsP=nTG
z<=Zl@@~;(CVf_MQvOC=Z<I;--)gPTv{x7M(=Vm(tZ#9pr=s(64`|n#Izv{m`tp<Ox
zh2xpO+R6NeQ{|(~O`L>HUBX@r^q9J&&D15_cLy|}7U^vHu~MyPH){Uxx2v5`?_pee
zxSe$nr_n~Zb+$=;WNkaw-Tuam%C-Q5GdsIS<$kt6I53f%_4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^CBB#TlFQ$VU2)}HT%J$3>PkN@
z-xp`tmHX}TeRayN)?aq@Jz42xJ(knUI_yfX{=0Rlm-};8di6Yq`{W+<@f;&_eR2+c
zTIY#AK1ZkAFZ1o^{=?P5E`1*dd46_nNZ+dsLvqeXzv`^H^4q6A_0r`FlXFiVtF8aS
z@c!SNSU&rS)TRe7zFujXdwb+#<<`@Iy9R#v^dq<aXZL;f*6*mVzkT%sKe+w#Z~Qg!
znHMi^J+*1;%h7GO-S*x`%iDI%oO|r|!|SU*TAF?0aP!4G6CZv2yQlM?{nsx?T2}A5
z|6=D0#jOkP+wu3+2QH+}oH_gIw>n<FYwfptCXcmme*USGsl9)k`SY*ddEIx1`^rl#
zb8Cmrz4O3``sOd*-#Y*6hi`fEOzrOP-TKzCTT;ajeRzZWl>;l!byp4_zJIKF)5m}Q
z$v4B*KV6yH{larQhmKy!d^vr=`NP2O+Y{&ReBz(AHHn9Q`nQEmuk5<VKDB9g%d_fQ
R_O)-s9{b{79)Et#e*xVi@s|Jq

diff --git a/rules/crda.make b/rules/crda.make
index 89e69da64..b5e4f32db 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_SOURCE) $(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
 # ----------------------------------------------------------------------------
@@ -54,6 +80,18 @@ CRDA_MAKE_ENV	:= \
 
 CRDA_MAKE_OPT	:= all_noverify
 
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/crda.install:
+	@$(call targetinfo)
+	@$(call world/install, CRDA)
+	@install -v -d $(CRDA_PKGDIR)/usr/lib/crda
+	@install -v -m 644 -t $(CRDA_PKGDIR)/usr/lib/crda \
+		$(CRDA_REGDB_DIR)/$(CRDA_REGDB)/regulatory.bin
+	@$(call touch)
+
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
@@ -73,8 +111,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)
 
-- 
2.18.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-07-04 13:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04 13:31 [ptxdist] [PATCH] crda: extend rule to download versioned regulatory.bin Michael Tretter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox