From patchwork Sat Feb 27 22:59:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 589460 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 21E6A140324 for ; Sun, 28 Feb 2016 10:00:37 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B47D6281452; Sun, 28 Feb 2016 00:00:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 8EF33283CF5 for ; Sun, 28 Feb 2016 00:00:12 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -7.6 Received: from hauke-m.de (hauke-m.de [5.39.93.123]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sun, 28 Feb 2016 00:00:10 +0100 (CET) Received: from hauke-desktop.fritz.box (p5DE97934.dip0.t-ipconnect.de [93.233.121.52]) by hauke-m.de (Postfix) with ESMTPSA id E527F1001AD; Sun, 28 Feb 2016 00:00:11 +0100 (CET) From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org, blogic@openwrt.org Date: Sat, 27 Feb 2016 23:59:49 +0100 Message-Id: <1456613992-31998-2-git-send-email-hauke@hauke-m.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456613992-31998-1-git-send-email-hauke@hauke-m.de> References: <1456613992-31998-1-git-send-email-hauke@hauke-m.de> Cc: Hauke Mehrtens Subject: [OpenWrt-Devel] [PATCH 2/5] ltq-vdsl-app: load the vrx200 firmware or patch it X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" This checks for the VRX firmware provided in the OpenWrt package. Signed-off-by: Hauke Mehrtens --- .../network/config/ltq-vdsl-app/files/dsl_control | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control index fc100cf..d7ba622 100644 --- a/package/network/config/ltq-vdsl-app/files/dsl_control +++ b/package/network/config/ltq-vdsl-app/files/dsl_control @@ -153,6 +153,47 @@ start_service() { ;; esac + if [ -z "${firmware}" ]; then + if grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo; then + case "${annex}" in + a|l|m) + if [ -f "/lib/firmware/lantiq-vrx200-a.bin" ]; then + firmware="/lib/firmware/lantiq-vrx200-a.bin" + elif [ -f "/tmp/lantiq-vrx200-a.bin" ]; then + firmware="/tmp/lantiq-vrx200-a.bin" + elif [ -f "/lib/firmware/lantiq-vrx200-b.bin" ] && [ -f "/lib/firmware/lantiq-vrx200-b-to-a.bspatch" ]; then + bspatch /lib/firmware/lantiq-vrx200-b.bin \ + /tmp/lantiq-vrx200-a.bin \ + /lib/firmware/lantiq-vrx200-b-to-a.bspatch + firmware="/tmp/lantiq-vrx200-a.bin" + else + echo "firmware for annex a not found" + return -1 + fi + ;; + b|j) + if [ -f "/lib/firmware/lantiq-vrx200-b.bin" ]; then + firmware="/lib/firmware/lantiq-vrx200-b.bin" + elif [ -f "/tmp/lantiq-vrx200-b.bin" ]; then + firmware="/tmp/lantiq-vrx200-b.bin" + elif [ -f "/lib/firmware/lantiq-vrx200-a.bin" ] && [ -f "/lib/firmware/lantiq-vrx200-a-to-b.bspatch" ]; then + bspatch /lib/firmware/lantiq-vrx200-a.bin \ + /tmp/lantiq-vrx200-b.bin \ + /lib/firmware/lantiq-vrx200-a-to-b.bspatch + firmware="/tmp/lantiq-vrx200-b.bin" + else + echo "firmware for annex b not found" + return -1 + fi + ;; + *) + echo "annex type not supported use a or b" + return -1 + ;; + esac + fi + fi + [ -z "${firmware}" ] && firmware=/lib/firmware/vdsl.bin [ -f "${firmware}" ] || { echo failed to find $firmware