From patchwork Sun May 10 17:03:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 470514 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.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7D22714012C for ; Mon, 11 May 2015 03:03:52 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=H4/DKDRh; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id A5A3B28433F; Sun, 10 May 2015 19:02:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, T_DKIM_INVALID autolearn=no version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id EFCB0289096 for ; Sun, 10 May 2015 19:02:13 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sun, 10 May 2015 19:02:13 +0200 (CEST) Received: by wgic8 with SMTP id c8so82990441wgi.1 for ; Sun, 10 May 2015 10:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=ts5k/+jkq5L0iPRSVhoQ0rZU5anOkR2TVOc85SSZNRY=; b=H4/DKDRhbmITZlJegKe+xgoUUIXChP2ygiFWYEKl3ps5Y3Yxyrne3/FoXGF0tH/rKe DdvngVWzCu3A2mtC4oePRVNulcP6wbdmxAIDgay+bkAE78NnfBPJQwE0X3aWsx5SZw9/ p0fEzLw/+qYhA/8A5uoqCBG2xGJqN2wA4//Mg5pTgEoYPZ1b5u9JW+4VZ+PG36RywrEQ Sb4qNU2HIMrFNdbFDQZZ+qllcHQcLr4USG3BQ06ge3TsDspuOxvXsCD95XKV/V78amqi J9V7k69N0yXrc8a46NgsUa3xIB1j3dyagmRfOaTEc1drhNAWm2qgVPD4Fi/PvcPqzLiF loyw== X-Received: by 10.194.186.145 with SMTP id fk17mr13361324wjc.156.1431277405754; Sun, 10 May 2015 10:03:25 -0700 (PDT) Received: from linux-tdhb.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by mx.google.com with ESMTPSA id be3sm9227938wib.21.2015.05.10.10.03.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 May 2015 10:03:24 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: John Crispin Date: Sun, 10 May 2015 19:03:15 +0200 Message-Id: <1431277395-22467-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH] lantiq: add platform_pre_upgrade for sysupgrade 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: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" As explained in recent sysupgrade/nand.sh commits, current NAND sysupgrade is a bit misleading because of nand_do_platform_check behavior. It leaves a special mark in /tmp/sysupgrade-nand-path triggering some diffent code path in nand_upgrade_stage1. The plan is to have the check function only check the image and nothing else. Then platform code (platform_pre_upgrade) should trigger NAND specific upgrade path. This is what this patch implements. Please note that because of current nand_upgrade_stage1 implemntation this patch doesn't change any behavior yet. It only prepares lantiq target for changing nand_do_platform_check (it will be possible after preparing all other targets as well). Signed-off-by: Rafał Miłecki --- target/linux/lantiq/base-files/lib/upgrade/platform.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/linux/lantiq/base-files/lib/upgrade/platform.sh b/target/linux/lantiq/base-files/lib/upgrade/platform.sh index 1688d3a..a892805 100755 --- a/target/linux/lantiq/base-files/lib/upgrade/platform.sh +++ b/target/linux/lantiq/base-files/lib/upgrade/platform.sh @@ -25,6 +25,17 @@ platform_check_image() { esac } +platform_pre_upgrade() { + local board=$(lantiq_board_name) + + case "$board" in + BTHOMEHUBV2B|BTHOMEHUBV3A|P2812HNUF* ) + nand_do_upgrade $1 + ;; + esac +} + + # use default for platform_do_upgrade() disable_watchdog() {