From patchwork Thu Aug 6 14:12:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Schmutzler X-Patchwork-Id: 1341739 X-Patchwork-Delegate: freifunk@adrianschmutzler.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=adrianschmutzler.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=WR8xVT0I; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BMr9g4C8yz9sTS for ; Fri, 7 Aug 2020 00:15:19 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QLEL6b6EAkxD8Cl5Np3IHMePGqj079zIkmEitwAs44E=; b=WR8xVT0I9NBrO1Fe0vi+05BbH4 aI05XqmmV0Yr1Oq6r4o8rXhLi9DBVVxIohBiEZxDK2x4zBVuEW9vmVOBwu6hGbfvzJER7Apm2Da/w PAXal7YS4D5A3qgkO/L2BN65ESG2OKy56/yY5ZkO08lA9dqOyA1HBB+C9StxmBxXsrWiVf3qTeMfI a0LAze0lr5lGI1ESxxeTH9tPIynodgoD4c1y0ZjyWvEgtBeDYRNNHzAKZWSRZdJIfiINlt7MDEaip sXy3Qw0xTqiFlKqZW4p+BkIbh74dSEmmsad7sEN3jQVcdOcs8VkGDfAE7rGDRizrCieumf/kp7EsD DAOYB9Yg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3geI-0001Rf-Sb; Thu, 06 Aug 2020 14:13:38 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k3geC-0001PT-G1 for openwrt-devel@lists.openwrt.org; Thu, 06 Aug 2020 14:13:34 +0000 Received: from buildfff.adridolf.com ([188.192.134.246]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MmlbE-1kTiLG1OgY-00jpco for ; Thu, 06 Aug 2020 16:13:28 +0200 From: Adrian Schmutzler To: openwrt-devel@lists.openwrt.org Subject: [PATCH 2/4] kirkwood: fix sysupgrade experience for early DSA-adopters Date: Thu, 6 Aug 2020 16:12:38 +0200 Message-Id: <20200806141241.34383-2-freifunk@adrianschmutzler.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200806141241.34383-1-freifunk@adrianschmutzler.de> References: <20200806141241.34383-1-freifunk@adrianschmutzler.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:06J/ThmU6zn463TaFfVqlR5YYhZQ3QhhcU+OdiY4/P+WSmq5sjF MygYa3PUDZ5JUoX0UyCgExQ9isGjQ/0E7a8JYiZ6DG0M6AvfPY9gJT2ZMXPU0bATLG9S3MP WUn8hBbtkkRCFreGlmMrETPCiJdEjoa0g6mYgL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) ) MR-646709E3 X-CRM114-CacheID: sfid-20200806_101332_782927_94708C32 X-CRM114-Status: GOOD ( 16.59 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.72.192.73 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [217.72.192.73 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Conceptually, the compat-version during sysupgrade is meant to describe the config. Therefore, if somebody starts with a device on 19.07 and swconfig, and that person does a forceful upgrade into a DSA-based firmware without wiping his/her config, then the local compat-version should stay at 1.0 according to the config present (and not get updated). However, this poses a problem for those people that early-adopted DSA in master, as they already have adjusted their config for DSA, but it still is "1.0" as far as sysupgrade is concerned. This can be healed by a simple uci set system.@system[0].compat_version="1.1" uci commit system But this needs to be applied _after_ the upgrade (as the "old" fwtool on the old installation does not know about compat_version) and it requires access via SSH (i.e. no pure GUI solution is available for this group of people, apart from wiping their config _again_ for no technical reason). Despite, the situation will not become obvious to those just upgrading via GUI, they will just have the experience of a "broken upgrade". This is a conflict which cannot be resolved by achieving both goals, we have to decide to either keep the strict concept or improve the situation for early adopters. In this patch, we address the issue by providing a uci-defaults script that will raise the compat_version for _all_ people upgrading into a 1.1 image, no matter whether they have reset config or not. The idea is implement this as a _temporary_ solution, so early adopters can upgrade into the new mechanism without issues, and after a few weeks/months we could remove the uci-defaults script again. If we e.g. remove the script just before 20.xx.0-rc1, early adopters should have moved on by then, and existing stable users would still get the intended experience. Signed-off-by: Adrian Schmutzler --- .../etc/uci-defaults/05_fix-compat-version | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 target/linux/kirkwood/base-files/etc/uci-defaults/05_fix-compat-version diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/kirkwood/base-files/etc/uci-defaults/05_fix-compat-version new file mode 100644 index 0000000000..d7f8488e88 --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/uci-defaults/05_fix-compat-version @@ -0,0 +1,16 @@ +# +# Copyright (C) 2020 OpenWrt.org +# + +. /lib/functions.sh + +case "$(board_name)" in + linksys,e4200-v2|\ + linksys,ea3500|\ + linksys,ea4500) + uci set system.@system[0].compat_version="1.1" + uci commit system + ;; +esac + +exit 0