From patchwork Wed Apr 20 05:55:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darryl Sokoloski X-Patchwork-Id: 612489 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qqWSX5zYKz9t3c for ; Wed, 20 Apr 2016 16:00:12 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id BDF8DB91F72; Wed, 20 Apr 2016 07:56:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 20 Apr 2016 07:56:07 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 62D12B91F25 for ; Wed, 20 Apr 2016 07:55:52 +0200 (CEST) X-policyd-weight: using cached result; rate: -6.1 Received: from mail.sokoloski.ca (unknown [45.56.111.28]) by arrakis.dune.hu (Postfix) with ESMTP for ; Wed, 20 Apr 2016 07:55:52 +0200 (CEST) Received: from zoltar.sokoloski.ca (unknown [10.0.4.6]) by mail.sokoloski.ca (Postfix) with ESMTP id A858A2671; Wed, 20 Apr 2016 01:55:51 -0400 (EDT) From: Darryl Sokoloski To: openwrt-devel@lists.openwrt.org Date: Wed, 20 Apr 2016 01:55:31 -0400 Message-Id: <1461131735-6064-6-git-send-email-darryl@sokoloski.ca> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1461131735-6064-1-git-send-email-darryl@sokoloski.ca> References: <1461131735-6064-1-git-send-email-darryl@sokoloski.ca> Subject: [OpenWrt-Devel] [PATCH 5/9] ipq806x/base-files: Add support for Archer C2600 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 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" Signed-off-by: Josh Bendavid [darryl@sokoloski.ca: submitting patches on behalf of Josh Bendavid] Signed-off-by: Darryl Sokoloski --- target/linux/ipq806x/base-files/lib/ipq806x.sh | 3 +++ .../linux/ipq806x/base-files/lib/upgrade/platform.sh | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh b/target/linux/ipq806x/base-files/lib/ipq806x.sh index db22708..73202c0 100644 --- a/target/linux/ipq806x/base-files/lib/ipq806x.sh +++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh @@ -17,6 +17,9 @@ ipq806x_board_detect() { *"AP148") name="ap148" ;; + *"C2600") + name="c2600" + ;; *"D7800") name="d7800" ;; diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index 542b5ce..a181f13 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -12,6 +12,14 @@ platform_check_image() { nand_do_platform_check $board $1 return $?; ;; + c2600) + local magic_long="$(get_magic_long "$1")" + [ "$magic_long" != "27051956" ] && { + echo "Invalid image, bad magic: $magic_long" + return 1 + } + return 0; + ;; *) return 1; esac @@ -29,4 +37,14 @@ platform_pre_upgrade() { esac } -# use default for platform_do_upgrade() +platform_do_upgrade() { + local board=$(ipq806x_board_name) + + case "$board" in + c2600) + PART_NAME="os-image:rootfs" + MTD_CONFIG_ARGS="-s 0x200000" + default_do_upgrade "$ARGV" + ;; + esac +}