From patchwork Wed Apr 8 21:35:05 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: 459503 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 A93591401E7 for ; Thu, 9 Apr 2015 07:35:55 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=wkpLtwfU; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id A9DEF280947; Wed, 8 Apr 2015 23:34:47 +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 A93572801AC for ; Wed, 8 Apr 2015 23:34:36 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Wed, 8 Apr 2015 23:34:36 +0200 (CEST) Received: by wgin8 with SMTP id n8so101687044wgi.0 for ; Wed, 08 Apr 2015 14:35:22 -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=4T0CpBe1FpktohTLWd+Vkcxl+W4YRShdfukqhVvPA1I=; b=wkpLtwfUhzFl0YYWo6AFlTntZ5XbcODCA/UsXzSuiYb1gz2lO+ZJNOLbYbt+6PLpkn XMYTrGrdnWskaf75/MfiWfbE+ytH8uEPacvpv7tWuabFM0V0qolyEbmfuBBO8bW9z4iO SP6wLvrYIjVkCIWfNs9TI6iGtu/Z4k3ZI80JiMRUcvlgz/xfZZgSK+HWl4mVnCa/6tPf YP4I7i8WqR/8oOVF6U6mjfqX0mHxheMt3QIkMHnY9pdOjryH67PZHDD/egl3Mf0f/iI7 WmJ3+olayu3R0CzLNhPGQBG4H0UeIYI2aKVBnx6boGsEOl6hAVRRVOCvp5+nyejLjmjX S0VQ== X-Received: by 10.194.21.193 with SMTP id x1mr53292210wje.144.1428528922780; Wed, 08 Apr 2015 14:35:22 -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 k6sm17377652wia.6.2015.04.08.14.35.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2015 14:35:21 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: openwrt-devel@lists.openwrt.org, Felix Fietkau , John Crispin , Gabor Juhos Date: Wed, 8 Apr 2015 23:35:05 +0200 Message-Id: <1428528907-9418-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Subject: [OpenWrt-Devel] [PATCH 1/2] base-files: add support for platform_pre_upgrade function 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" Current NAND sysupgrade process is a bit hard to follow due to the way of triggering stage1. Currently this is done by leaving a /mark/ in the form of /tmp/sysupgrade-nand-path during nand_do_platform_check. Existence of this mark stops standard sysupgrade process (as the result of sysupgrade_pre_upgrade exit). This may be a bit misleading. Proposed solution adds a new function that will allow platform.sh trigger NAND sysupgrade consciously. This will also allow cleaning nand_do_platform_check limiting it to just checking the image. Signed-off-by: Rafał Miłecki --- package/base-files/files/sbin/sysupgrade | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 215f482..ef83c4b 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -215,6 +215,14 @@ fi run_hooks "" $sysupgrade_pre_upgrade +# Some platforms/devices may want different sysupgrade process, e.g. without +# killing processes yet or calling ubus system upgrade method. +# This is needed e.g. on NAND devices where we just want to trigger stage1 at +# this point. +if type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then + platform_pre_upgrade "$ARGV" +fi + ubus call system upgrade touch /tmp/sysupgrade