From patchwork Sat Dec 12 06:45:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Martynov X-Patchwork-Id: 555950 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 D6ABB1402D9 for ; Sat, 12 Dec 2015 17:46:49 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=GEqh7x2d; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id A2D3628A9A9; Sat, 12 Dec 2015 07:45:51 +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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 208BC28A268 for ; Sat, 12 Dec 2015 07:45:38 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-ig0-f173.google.com (mail-ig0-f173.google.com [209.85.213.173]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 12 Dec 2015 07:45:33 +0100 (CET) Received: by mail-ig0-f173.google.com with SMTP id g19so53840746igv.1 for ; Fri, 11 Dec 2015 22:45:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=XgMACFXk6qwhhI7crW+1M4BIcmY255DOFRl/n12UvmQ=; b=GEqh7x2dDHSWw3mv2G88Na7M53a8SZWlTh0ZueY/X/WgP4shk+InanvIpAwMrFF/3O dHVSpc10EYleABwQNC9ND+wVhterDCduXwZWTn+LCklkV+r9g63soAYFreZx6e/jAB2u ZTeOAx9loPnHfz9uSPZKJqLexbIXcykaia8Y5uijTQB3ENhKzrAUPJO2d+W3d5L/DvaC vbLLfeT8KHWYI7xoz2Y99SDmvcm50wx/HWdF7ZCAkue2agJLutEgdLsCQMk3ruyYnMbY PQAYm3HkqjdINcUCknnKUbTyPNeNr00u2oEU5XEsy1190+FWjz4gFetvxVqwCmVu9mAe VPvA== X-Received: by 10.50.17.74 with SMTP id m10mr8696754igd.8.1449902743913; Fri, 11 Dec 2015 22:45:43 -0800 (PST) Received: from kolya-laptop.shuttercorp.net (dhcp-108-170-142-183.cable.user.start.ca. [108.170.142.183]) by smtp.gmail.com with ESMTPSA id k16sm8268569iok.8.2015.12.11.22.45.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Dec 2015 22:45:43 -0800 (PST) From: Nikolay Martynov To: blogic@openwrt.org Date: Sat, 12 Dec 2015 01:45:26 -0500 Message-Id: <1449902727-21571-1-git-send-email-mar.kolya@gmail.com> X-Mailer: git-send-email 2.6.4 Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH 1/2] nand upgrade: add 'platform_nand_pre_upgrade' 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" Add 'platform_nand_pre_upgrade' callback to allow platform specific preparation right before flashinng, when already in ramdisk. Example uses might be setting correct values for CI_{KERNPART,UBIPART}. Signed-off-by: Nikolay Martynov --- package/system/procd/files/nand.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/system/procd/files/nand.sh b/package/system/procd/files/nand.sh index 0c179cb..8b0564d 100644 --- a/package/system/procd/files/nand.sh +++ b/package/system/procd/files/nand.sh @@ -275,6 +275,10 @@ nand_upgrade_tar() { nand_do_upgrade_stage2() { local file_type=$(identify $1) + if type 'platform_nand_pre_upgrade' >/dev/null 2>/dev/null; then + platform_nand_pre_upgrade "$1" + fi + [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs" case "$file_type" in