From patchwork Fri Dec 22 06:02:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 10128827 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB0896019D for ; Fri, 22 Dec 2017 06:03:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCA1B298AA for ; Fri, 22 Dec 2017 06:03:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C18A129D77; Fri, 22 Dec 2017 06:03:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D9A6298AA for ; Fri, 22 Dec 2017 06:03:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752043AbdLVGDP (ORCPT ); Fri, 22 Dec 2017 01:03:15 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:38688 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751602AbdLVGDM (ORCPT ); Fri, 22 Dec 2017 01:03:12 -0500 Received: from mail-io0-f198.google.com ([209.85.223.198]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1eSGQJ-0002e2-2o for linux-wireless@vger.kernel.org; Fri, 22 Dec 2017 06:03:11 +0000 Received: by mail-io0-f198.google.com with SMTP id t73so18835065iof.6 for ; Thu, 21 Dec 2017 22:03:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/cRRgM3wYv8lerYTk6LfFEpaplGDWbDxl0c1x5uu7qs=; b=OIIfqK46whDrfV+fDZa390kNrzIkjOP6pZ3s+qoDeu7hdtMNcAk5zJtMQYBE4j/ZcX H0Aco72RV/0lSQQZQRkyz6ZzGjjxPYl1wPlXOYAfnRRjrmFb7qViMyhC2URA16Ae6i84 EFzz+qtORAynQ5aeqWcFnsPQqIres3MCXBCDO72Sa9iQcU00oWyZl30fB15s1PB03vje X3CFQd9PSRbfa4fD/apdx74E4OPzx5HBu7IHc73GXT+nIyW6BFz7gB5fQuL1DN8GfP3+ 5gl8Zl+3BnD3vdjoaSQ8jqLttVIcVfUbrwa8OmUzIMaMHy8CCNH4oi8scqa1gWZRQHkW k1lQ== X-Gm-Message-State: AKGB3mKALK98gvcGW0jBHhEn7teWKDaxLt49of2rn6LkBe38Zqjekz65 vQCv5B/P+LZ6qhG2PgFke2F7YHeezduR1byuJ5B5jagQy/DzvE8kdlQVM/1ZbmHjYZYheEFBh66 Xk4udTZE9mUr8xtb9XNooqUF9fJN/mxWlYdgfhStU+/9A X-Received: by 10.36.4.72 with SMTP id 69mr15842368itb.33.1513922589536; Thu, 21 Dec 2017 22:03:09 -0800 (PST) X-Google-Smtp-Source: ACJfBov8ndP4nZXblFzl52b/IixKPKTvNyU4aXZHldH7dTxyQj3oLIUutUIRXXRNRfSWLAMKxI194Q== X-Received: by 10.36.4.72 with SMTP id 69mr15842349itb.33.1513922589248; Thu, 21 Dec 2017 22:03:09 -0800 (PST) Received: from localhost ([2605:a601:aae:1b20:ed05:64dd:188e:d39c]) by smtp.gmail.com with ESMTPSA id d191sm11387988iog.41.2017.12.21.22.03.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Dec 2017 22:03:08 -0800 (PST) From: Seth Forshee To: linux-wireless@vger.kernel.org, wireless-regdb@lists.infradead.org Cc: Johannes Berg Subject: [PATCH 2/6] wireless-regdb: Restore generation of old format database files Date: Fri, 22 Dec 2017 00:02:59 -0600 Message-Id: <20171222060303.14478-3-seth.forshee@canonical.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171222060303.14478-1-seth.forshee@canonical.com> References: <20171222060303.14478-1-seth.forshee@canonical.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Johannes removed generation and installation of these files when adding support for the new database format. We need to keep generating these files to support distros still using CRDA, so restore support for building and installing these files in the makefile. Signed-off-by: Seth Forshee --- Makefile | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index e708982a453d..9532c29a1dc2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ # Install prefix PREFIX ?= /usr +CRDA_PATH ?= $(PREFIX)/lib/crda +CRDA_KEY_PATH ?= $(CRDA_PATH)/pubkeys MANDIR ?= $(PREFIX)/share/man/ @@ -28,26 +30,33 @@ REGDB_AUTHOR ?= $(shell if [ -f $(DISTRO_PRIVKEY) ]; then \ fi) REGDB_PRIVKEY ?= ~/.wireless-regdb-$(REGDB_AUTHOR).key.priv.pem +REGDB_PUBKEY ?= $(REGDB_AUTHOR).key.pub.pem REGDB_PUBCERT ?= $(REGDB_AUTHOR).x509.pem +REGDB_UPSTREAM_PUBKEY ?= sforshee.key.pub.pem + REGDB_CHANGED = $(shell $(SHA1SUM) -c --status sha1sum.txt >/dev/null 2>&1; \ if [ $$? -ne 0 ]; then \ - echo maintainer-clean $(REGDB_PUBCERT); \ + echo maintainer-clean $(REGDB_PUBKEY) $(REGDB_PUBCERT); \ fi) .PHONY: all clean mrproper install maintainer-clean install-distro-key -all: $(REGDB_CHANGED) regulatory.db.p7s sha1sum.txt +all: $(REGDB_CHANGED) regulatory.bin sha1sum.txt regulatory.db.p7s clean: @rm -f *.pyc *.gz maintainer-clean: clean - @rm -f regulatory.db regulatory.db.p7s + @rm -f regulatory.bin regulatory.db regulatory.db.p7s mrproper: clean maintainer-clean - @echo Removed public key, regulatory.db* and compressed man pages - @rm -f $(REGDB_PUBCERT) .custom + @echo Removed public key, regulatory.bin, regulatory.db* and compressed man pages + @rm -f $(REGDB_PUBKEY) $(REGDB_PUBCERT) .custom + +regulatory.bin: db.txt $(REGDB_PRIVKEY) $(REGDB_PUBKEY) + @echo Generating $@ digitally signed by $(REGDB_AUTHOR)... + ./db2bin.py regulatory.bin db.txt $(REGDB_PRIVKEY) regulatory.db: db.txt db2fw.py @echo "Generating $@" @@ -64,6 +73,10 @@ regulatory.db.p7s: regulatory.db $(REGDB_PRIVKEY) $(REGDB_PUBCERT) sha1sum.txt: db.txt sha1sum $< > $@ +$(REGDB_PUBKEY): $(REGDB_PRIVKEY) + @echo "Generating public key for $(REGDB_AUTHOR)..." + openssl rsa -in $(REGDB_PRIVKEY) -out $(REGDB_PUBKEY) -pubout -outform PEM + $(REGDB_PUBCERT): $(REGDB_PRIVKEY) @echo "Generating certificate for $(REGDB_AUTHOR)..." @openssl req -config regulatory.openssl.conf \ @@ -103,7 +116,13 @@ install-distro-key: maintainer-clean $(DISTRO_PRIVKEY) # make maintainer-clean # make # sudo make install -install: regulatory.db.5.gz - install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.db +install: regulatory.bin.5.gz regulatory.db.5.gz + install -m 755 -d $(DESTDIR)/$(CRDA_PATH) + install -m 755 -d $(DESTDIR)/$(CRDA_KEY_PATH) + if [ -f .custom ]; then \ + install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(shell cat .custom); \ + fi + install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(REGDB_UPSTREAM_PUBKEY) + install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.bin regulatory.db install -m 755 -d $(DESTDIR)/$(MANDIR)/man5/ - install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.db.5.gz + install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.bin.5.gz