From patchwork Thu Nov 29 09:36:57 2018 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: 1005252 X-Patchwork-Delegate: openwrt@kresin.me 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="rH154GH/"; 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 435C9p2hmbz9s3Z for ; Thu, 29 Nov 2018 20:37:49 +1100 (AEDT) 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=d13wXnPiP7quhj50gOMYOBqlj3RysuVU9ntndyuQtfQ=; b=rH154GH/3NOuiE 1nXn+KkDMcBQe5wjC407YquMgmdx12ANhcEdAGY6uNGJ+VgzMEnx/RvnXEZB7kT+Y9yGwOAIevXh+ AczZwhHILh3PBvcehOHBBCbpU4xdXYAkRoLfQSBPrn1xn6evIEgcAg9A/3tDqbvYiweAeHomgY394 5Sju6sZjs8sZFtTW/RB2o4q1kR7DFGqcJ7xFRBKGm7bzK5ySO26brQSzZeb+9NbbjTEAE9sGTTdy0 AL/KeGpKXvjffQpsZAbKhA5pb1zJqcrAX/5z8qWD+7gPX21B6sCjygdpc9RHTtNwd00Tct/n0dny0 1NLVE2JVTXd4gci9WZFg==; 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 1gSIlB-0001LT-MT; Thu, 29 Nov 2018 09:37:25 +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 1gSIl8-0001KU-17 for openwrt-devel@lists.openwrt.org; Thu, 29 Nov 2018 09:37:23 +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 26DA936A0; Thu, 29 Nov 2018 10:37:06 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by meh.true.cz (OpenSMTPD) with ESMTP id 279015c2; Thu, 29 Nov 2018 10:37:04 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Thu, 29 Nov 2018 10:36:57 +0100 Message-Id: <1543484217-17306-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-20181129_013722_223824_1C4C5263 X-CRM114-Status: UNSURE ( 6.16 ) 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 http://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH] ramips: upgrade: Enable checking of image metadata 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?= , Mathias Kresin Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Checking metadata in image before flashing is nice for a good user experience and bricking protection as well, so enable it by default for all boards but the four legacy ones. Cc: Mathias Kresin Signed-off-by: Petr Štetiar --- target/linux/ramips/base-files/lib/upgrade/platform.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index e28f066..9f36c47 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -4,6 +4,23 @@ PART_NAME=firmware +enable_image_metadata_check() { + local board=$(board_name) + + case "$board" in + all0239-3g|\ + dcs-930|\ + dcs-930l-b1|\ + wl-341v3) + REQUIRE_IMAGE_METADATA=0 + ;; + *) + REQUIRE_IMAGE_METADATA=1 + ;; + esac +} +enable_image_metadata_check + platform_check_image() { local board=$(board_name) local magic="$(get_magic_long "$1")"