From patchwork Fri Jun 26 12:30:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kurt Van Dijck X-Patchwork-Id: 1317617 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vandijck-laurijssen.be Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49tbpd0qcyz9sPF for ; Fri, 26 Jun 2020 22:31:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D22E687D22; Fri, 26 Jun 2020 12:31:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HBgpWsKojFjj; Fri, 26 Jun 2020 12:31:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A3B8D86DF4; Fri, 26 Jun 2020 12:31:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 0D72E1BF989 for ; Fri, 26 Jun 2020 12:31:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0623B8851B for ; Fri, 26 Jun 2020 12:31:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wRhg1U5KeoYG for ; Fri, 26 Jun 2020 12:31:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay-b01.edpnet.be (relay-b01.edpnet.be [212.71.1.221]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7ABDF87E9E for ; Fri, 26 Jun 2020 12:31:11 +0000 (UTC) X-ASG-Debug-ID: 1593174668-0a7ff53caa3eb5e0001-rUBnyj Received: from zotac.vandijck-laurijssen.be (77.109.122.82.adsl.dyn.edpnet.net [77.109.122.82]) by relay-b01.edpnet.be with ESMTP id 0i8BGCp7h8pHTLtS for ; Fri, 26 Jun 2020 14:31:08 +0200 (CEST) X-Barracuda-Envelope-From: dev.kurt@vandijck-laurijssen.be X-Barracuda-Effective-Source-IP: 77.109.122.82.adsl.dyn.edpnet.net[77.109.122.82] X-Barracuda-Apparent-Source-IP: 77.109.122.82 Received: from x1.vandijck-laurijssen.be (x1.vandijck-laurijssen.be [192.168.0.36]) by zotac.vandijck-laurijssen.be (Postfix) with ESMTPSA id 9A6D1F71F9E; Fri, 26 Jun 2020 14:31:08 +0200 (CEST) From: Kurt Van Dijck To: buildroot@buildroot.org Date: Fri, 26 Jun 2020 14:30:51 +0200 X-ASG-Orig-Subj: [PATCH 4/6] wireless-regdb: add option to rebuild Message-Id: <20200626123053.30626-5-dev.kurt@vandijck-laurijssen.be> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200626123053.30626-1-dev.kurt@vandijck-laurijssen.be> References: <20200626123053.30626-1-dev.kurt@vandijck-laurijssen.be> MIME-Version: 1.0 X-Barracuda-Connect: 77.109.122.82.adsl.dyn.edpnet.net[77.109.122.82] X-Barracuda-Start-Time: 1593174668 X-Barracuda-URL: https://212.71.1.221:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at edpnet.be X-Barracuda-Scan-Msg-Size: 2717 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.7751 1.0000 1.9928 X-Barracuda-Spam-Score: 1.99 X-Barracuda-Spam-Status: No, SCORE=1.99 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=7.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.82819 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Subject: [Buildroot] [PATCH 4/6] wireless-regdb: add option to rebuild X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kurt Van Dijck Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In some countries, different regulations apply for indoor and outdoor use. The precompiled binary of wireless-regdb is for indoor use only. If your product is for outdoor use, or for other deviations, you may need to rebuild the patched or modified wireless-regdb. Building is done explicitely using python3 Signed-off-by: Kurt Van Dijck --- package/wireless-regdb/Config.in | 15 +++++++++++++++ package/wireless-regdb/wireless-regdb.mk | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/package/wireless-regdb/Config.in b/package/wireless-regdb/Config.in index 17350a41d8..55347b5e8c 100644 --- a/package/wireless-regdb/Config.in +++ b/package/wireless-regdb/Config.in @@ -12,3 +12,18 @@ config BR2_PACKAGE_WIRELESS_REGDB application is needed. https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb + +if BR2_PACKAGE_WIRELESS_REGDB + +config BR2_WIRELESS_REGDB_REBUILD + bool "rebuild wireless-regdb" + help + Say no to use the pre-built wireless regdb. + + Say yes if you need to deploy a modified wireless-regdb. + Deviations to the precompiled upstream wireless-regdb may be required + e.g. if you plan to deploy your product outdoor in countries where + outdoor and indoor regulations differ. + Make sure to deploy your wireless-regdb public key if you use crda + or compile them into the kernel. +endif diff --git a/package/wireless-regdb/wireless-regdb.mk b/package/wireless-regdb/wireless-regdb.mk index 31b62e36e1..7c6b140a4a 100644 --- a/package/wireless-regdb/wireless-regdb.mk +++ b/package/wireless-regdb/wireless-regdb.mk @@ -10,12 +10,30 @@ WIRELESS_REGDB_SITE = $(BR2_KERNEL_MIRROR)/software/network/wireless-regdb WIRELESS_REGDB_LICENSE = ISC WIRELESS_REGDB_LICENSE_FILES = LICENSE + +ifeq ($(BR2_WIRELESS_REGDB_REBUILD),y) + +define WIRELESS_REGDB_PATCH_PYTHON3 + sed -i -e '1 s/python$$/python3/' $(@D)/*.py +endef + +WIRELESS_REGDB_POST_PATCH_HOOKS += WIRELESS_REGDB_PATCH_PYTHON3 + +WIRELESS_REGDB_DEPENDENCIES += host-python3-m2crypto +define WIRELESS_REGDB_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \ + REGDB_AUTHOR=buildroot +endef +endif + ifeq ($(BR2_PACKAGE_CRDA),y) define WIRELESS_REGDB_INSTALL_CRDA_TARGET_CMDS $(INSTALL) -m 644 -D -T $(@D)/regulatory.bin \ $(TARGET_DIR)/usr/lib/crda/regulatory.bin $(INSTALL) -m 644 -D -T $(@D)/sforshee.key.pub.pem \ $(TARGET_DIR)/etc/wireless-regdb/pubkeys/sforshee.key.pub.pem + $(INSTALL) -m 644 -D -T ~/.wireless-regdb-buildroot.key.pub.pem \ + $(TARGET_DIR)/etc/wireless-regdb/pubkeys/buildroot.key.pub.pem endef endif