From patchwork Mon Oct 17 13:59:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 682989 X-Patchwork-Delegate: nbd@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3syKdj1h1Tz9sQw for ; Tue, 18 Oct 2016 01:02:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b=mQysDX2H; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bw8Sc-0006Ic-To; Mon, 17 Oct 2016 14:00:14 +0000 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bw8S6-0005Mo-DM for lede-dev@lists.infradead.org; Mon, 17 Oct 2016 13:59:46 +0000 Received: by mail-qk0-x242.google.com with SMTP id v138so14168692qka.2 for ; Mon, 17 Oct 2016 06:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=HoXIecxULIqOxauJTIIKkEm3ZhbawIHldMj80+IISKU=; b=mQysDX2HBLoXAJjLZkwfCSP0XCehdIbD3Xp42UI+sWid2vDxLLbFvXtccSdPgoiGOz SrUvvzSiYR2xGzRB9nXzl/EdCWxS/zerEhqFxRWYu1SgA4YCpgc0mWdy+VSiyq3SH6ig Er/G65Mb5OO5T++jtEeLM18nrmhaDM5Wj158wv9VQrN5i8DLEgA2CzEopkC4q5uoz42N Wf/C/yOkzZaH1okTo2CBPp/u0q6vFfcuGIO83JPUs4q5LqqIDhzFsW/eRebwRlCpKk7m AyZku1STDRokYgJg4Ug2mEZmnlRloT2t7oSoYRFvQh57djXjZmg751utQaAwZ5sFFiIW 3Ttg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HoXIecxULIqOxauJTIIKkEm3ZhbawIHldMj80+IISKU=; b=KWc8Rwp56kIFx8xCksU2g18YNttyBe9scz+pMzS8o9mjNGILNhh9T+1I6EEm+EizBB fh2vpr8IjEwvtKP+wfjvxkwMOh2r6VWKxSHkGeckeragqnf7xDsRUDZJuPzVZ8JreUiV J+KyzDDQGdGknQ55JEH9F2+wWicOTfk8ZTD1A3qkFZqmDMX3MQVqqHDDMxv5nzwRxEiq vGe6raNlZdQ17K6Rmiv4zft+395lgrMEn5jK93HBbYaxO2Qtk/Fi/RB5C3gPRjhIzM+x mn+1lHPMYmTUnKUKU/Px+Tp28pPQfAblQ7yIHNe0uwFY/Z0YTKfs9K++rNZ3BDrtwGsG gbTQ== X-Gm-Message-State: AA6/9RkfGzjQ9+ZyuDnI0B05QaFK8HALCSIhZxuNbJ+cHpuAtX9xTMobp5rhc9eErrOZWg== X-Received: by 10.194.23.4 with SMTP id i4mr11094738wjf.185.1476712759701; Mon, 17 Oct 2016 06:59:19 -0700 (PDT) Received: from debian64.daheim (pD9F882B9.dip0.t-ipconnect.de. [217.248.130.185]) by smtp.gmail.com with ESMTPSA id qa7sm53261071wjc.39.2016.10.17.06.59.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Oct 2016 06:59:18 -0700 (PDT) From: Christian Lamparter X-Google-Original-From: Christian Lamparter Received: from chuck by debian64.daheim with local (Exim 4.87) (envelope-from ) id 1bw8Rg-00047i-SZ; Mon, 17 Oct 2016 15:59:16 +0200 To: lede-dev@lists.infradead.org Date: Mon, 17 Oct 2016 15:59:12 +0200 Message-Id: <4f69ed95593be50265c586c8f4be50ca3eca885c.1476631806.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161017_065942_842230_AC15D920 X-CRM114-Status: UNSURE ( 8.28 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400d:c09:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]googlemail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [LEDE-DEV] [PATCH v3 1/4] base-files: generate /etc/config/wireless, if it doesn't exist X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , Jo-Philipp Wich , Matthias Schiffer , Mathias Kresin , Jonas Gorski MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Mathias Kresin This patch adds a check in "wifi detect" to test if the wireless configuration file does exist. If it doesn't exist, an empty /etc/config/wireless file will be created. This is necessary because uci doesn't create new files, instead the tool just exits with "uci: Entry not found". Signed-off-by: Mathias Kresin Signed-off-by: Christian Lamparter --- package/base-files/files/sbin/wifi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index 6bd3544..2ef333a 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -146,6 +146,8 @@ wifi_reload() { } wifi_detect() { + [ ! -f /etc/config/wireless ] && touch /etc/config/wireless + for driver in $DRIVERS; do ( if eval "type detect_$driver" 2>/dev/null >/dev/null; then eval "detect_$driver" || echo "$driver: Detect failed" >&2