From patchwork Mon May 13 15:28:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1098950 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gLZ6NjNe"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 452l8x3lkGz9sBr for ; Tue, 14 May 2019 01:29:04 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=c33i2d5XQf+Ue2DVS+89EVFyRxHtOj4//OK88j245lk=; b=gLZ6NjNewWZX3T a2xRwXVonVDsOW3d4Nmu2cPhzOa69DxCO2SCkvVVQ3MD6Ija9eIRBHm3ziwIxpusmyWJJzDIU3eUX m/02dxN1W70HYLngdBY0oTUBqwcSd1McLcWnLGiG4mqgHeDixiRIIQZk61+dt8jQAw6p6HMkyfz/Z r2yoaN2U+jlv6IUnGjqZvGxDL/CWdr0O0EgKEbV3mSDWDgF1KQng3+n47axn2HPtl9PBn9wP2wVbD jyPYSdsKI4MK4P+sgfHrsGnNyigxLBbRLFZ5c6an/3kIwT2LGfSZ0sTRibb2SswA5eOx9OrDsfq+c S0VioSDUP2jFACJfUkvw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQCse-00064k-MZ; Mon, 13 May 2019 15:28:44 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQCsU-0005m0-5A for openwrt-devel@lists.openwrt.org; Mon, 13 May 2019 15:28:38 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 4D0D1377D; Mon, 13 May 2019 17:28:28 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id f838b790; Mon, 13 May 2019 17:28:26 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Mon, 13 May 2019 17:28:24 +0200 Message-Id: <1557761304-5994-1-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190513_082834_612706_15DAF1EE X-CRM114-Status: UNSURE ( 8.48 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH] imx6: apalis: fix config survival after sysupgrade -n X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch fixes `sysupgrade -n` when flashed with rootfs of the same size as currently running, so the rootfs_data wouldn't get destroyed and thus survive reboot. So let's fix it by always cleaning up the content of the rootfs_data during sysupgrade. Signed-off-by: Petr Štetiar --- target/linux/imx6/base-files/lib/upgrade/platform.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/linux/imx6/base-files/lib/upgrade/platform.sh b/target/linux/imx6/base-files/lib/upgrade/platform.sh index 2d76b6b4af33..fe3bf2184fc7 100755 --- a/target/linux/imx6/base-files/lib/upgrade/platform.sh +++ b/target/linux/imx6/base-files/lib/upgrade/platform.sh @@ -72,3 +72,13 @@ platform_copy_config() { ;; esac } + +platform_pre_upgrade() { + local board=$(board_name) + + case "$board" in + apalis*) + [ "$SAVE_CONFIG" -eq 0 ] && jffs2reset -y + ;; + esac +}