From patchwork Sun Jan 21 17:53:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 864076 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="i14fQQb+"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zPhyH2SHdz9s7F for ; Mon, 22 Jan 2018 04:53:59 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AtADScP/Mu3ispSIU9HLOysjR5s8x+pUJyE82ZqXGYc=; b=i14fQQb+rwMO1i 2t9OLlzA1w0lzE9ivEk8IJyomSMZzNSi47GBNT7xGo7NbpswFgdohoGOnaGPMem4J0ve69C/qWdRQ 3hcAVy/2XPrPaYyuTcjmiE6dFRf+WGEGSSQIADIRoTEDo82mOIOjqEcHRp8NLDMSGk5oUkyXIbYne vYma6slHbUB3rUEahjaB1WE7PAWoxsmAxCfUNqN8g7wNXsv/4ijcvH+qcAG69JEPyGCFw+ZfNznGt gUfyf9sBVIyqzgL/8JccBMFS3jBQaWKHixPtYq8Tvj+bxwiqTBSBro9dTOyzBzNDEk46RbF/E2+cw JHpBOGFglI/VrW5oyEIw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1edJoa-0004vn-M6; Sun, 21 Jan 2018 17:53:56 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1edJoX-0004YV-8w for lede-dev@lists.infradead.org; Sun, 21 Jan 2018 17:53:55 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id E33E541088; Sun, 21 Jan 2018 18:53:44 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id Sb21QlT43c-1; Sun, 21 Jan 2018 18:53:38 +0100 (CET) From: Hauke Mehrtens To: lede-dev@lists.infradead.org, kaloz@openwrt.org Date: Sun, 21 Jan 2018 18:53:08 +0100 Message-Id: <20180121175308.15585-6-hauke@hauke-m.de> In-Reply-To: <20180121175308.15585-1-hauke@hauke-m.de> References: <20180121175308.15585-1-hauke@hauke-m.de> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [80.241.60.215 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH v2 5/5] mvebu: migrate uci config to new PCIe path X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hauke Mehrtens , tomek_n@o2.pl, luci@createc.ro MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The name of the PCIe controller node in device tree changed between kernel 4.9 and kernel 4.14. Migrate the configuration when an update from kernel 4.9 to 4.14 is done to the new name to make the existing wifi configuration compatible with the new names. This replaces the "pcie-controller" part with "pcie" on all nodes if the file exists in sys fs. This will not do anything with on kernel 4.9. The configuration will not be fixed when migrating back from kernel 4.14 to kernel 4.9. Signed-off-by: Hauke Mehrtens --- .../base-files/etc/uci-defaults/05-migrate-wifi | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi diff --git a/target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi b/target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi new file mode 100644 index 0000000000..6f7858da3d --- /dev/null +++ b/target/linux/mvebu/base-files/etc/uci-defaults/05-migrate-wifi @@ -0,0 +1,23 @@ +#!/bin/sh + +[ ! -e /etc/config/wireless ] && exit 0 + +. /lib/functions.sh + +PATH_CHANGED=0 + +rename_wifi_path() { + local path_old=$(uci get wireless.${1}.path) + local path_new=$(echo ${path_old} | sed "s/pcie-controller/pcie/") + + if [ -e "/sys/devices/${path_new}" ] && [ ${path_old} != ${path_new} ] + then + uci set wireless.${1}.path=${path_new} + PATH_CHANGED=1 + fi +} + +config_load wireless +config_foreach rename_wifi_path wifi-device + +[ "$PATH_CHANGED" = "1" ] && uci commit wireless