From patchwork Mon Jun 11 10:52:42 2018 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: 927604 X-Patchwork-Delegate: blogic@openwrt.org 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hQg2fmZE"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Aze1mQQb"; 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 4148zq73dgz9rxs for ; Mon, 11 Jun 2018 20:54:59 +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=zEqI1KDx4uSL5l8rANdHQUL4uEgzpwPGOcCpqRYhz/g=; b=hQg2fmZEuSZ3aB 332jLOJmHel9rTJjOonvudwdCaX8HYhYyBYck2RRj4DpRuJ3Fi3LNq6PpT1YybY7I4KHcsYCL9Hkr NCUIs6H11fsZiGBcy5zaWCxAcGKyyd2xlvtnJIV7Y1f+jTiVE0KQUFcBlZL0PGrHAgFvFXI1wxGAP ngj35UQd2RcXpIFnxfGBF6sxDCxFD7YCjusnBkrLP4IoibFtezH3Ycdd79hk57Zu6uHQo3gmFaNYq ADA6PweBmRDsqKXfvqrs93oD2An/7ni4Z6xMMo+Zg5WY7Yvmw6jLlBrCwF//5BYkD2lvCNDroei5J 5ds6XjfNhjyDsHC5sDtA==; 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 1fSKTG-0005SF-0x; Mon, 11 Jun 2018 10:54:46 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSKTD-0005Pr-0A for lede-dev@lists.infradead.org; Mon, 11 Jun 2018 10:54:44 +0000 Received: by mail-lf0-x242.google.com with SMTP id v135-v6so29821239lfa.9 for ; Mon, 11 Jun 2018 03:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mMqDtV5n0GL+S7M18TBfiU4RzsVu9eZLfnxZ6uf9nbw=; b=Aze1mQQbfNex3yfnsN7FA+ksPqaiTqh2+c2wbpgFCx/q2uNJE7Pk2NgcF87uIfxwuE RxGnxlIr7ndjqG0Of3sIqxrTp6iB3llaD/APzuoOdu92u6g9kYraI4Z0ZN1GpsSeAICg i29+7bj1F2MKGjUZM/FUE/U/5pY/4dCXStaQVRjXLhNnpNS++K7fwyTZHPl+ZUkjEai8 R68GKyh2rv+3gTRpB5SRSYld90T+RQC/ahE18DLLZFmyL38vcYypGIq/WCLyIH5Cao3c L7GXU0qsCtLRBe/8DWqIRg5Ew30PMUSo4rAmM2yPBwRabpXRhb9ZsGsxv/PghI4rW0i4 bb0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mMqDtV5n0GL+S7M18TBfiU4RzsVu9eZLfnxZ6uf9nbw=; b=Lw2b9mp7Wp1+sa1jDqADLGm3WINkNbHNUt1dRoqbDnklxLeiJpoF63yJ7SEr4nzgYk kEffGEEG1I/zZOVtqJ6BBhQ2Ku92KUxO/29X4/JMX6zJD6iFxlts0xxrEfNmQTSEZZqY nuKiAj6Pfnl5Yj57887a8glae7MVs/aXcy6O4hCGCNoQVQIsLj3BQfNZwZqcVFLKVWig LFUMSzon8igT9ST6CPe9fvtuMO/D2mV20oYq7/ronyPrxqI26K7bZ4gGUOGZnoG+1dbh OHLGmBmhXVIupduwdvsU9f8ngezp1SDHOyRyOTHGYU5N0uHREBsjWMZ8oulsG0TiQohZ 16OA== X-Gm-Message-State: APt69E0L9UlgKa+YiJexnQFhu1nG/ROfGHu99V2JevJMBSlfmnANjdEC Iz1Rwl46BdqHdRHQSQQnNvld5w== X-Google-Smtp-Source: ADUXVKKeJQg3bCD3JAvsr1D36Ci5Yo2rxVAlzvhRE9Qx0jGm8WDd48s7LFU7uPaMvdJKA+L+Ifpn+w== X-Received: by 2002:a19:a892:: with SMTP id r140-v6mr9906233lfe.39.1528714470553; Mon, 11 Jun 2018 03:54:30 -0700 (PDT) Received: from linux-veee.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id d2-v6sm5493930lfa.75.2018.06.11.03.54.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jun 2018 03:54:29 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: openwrt-devel@lists.openwrt.org Date: Mon, 11 Jun 2018 12:52:42 +0200 Message-Id: <20180611105242.31637-1-zajec5@gmail.com> X-Mailer: git-send-email 2.13.7 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180611_035443_067313_C9BB68B2 X-CRM114-Status: GOOD ( 10.12 ) X-Spam-Score: 0.9 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:242 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid 1.2 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list Subject: [OpenWrt-Devel] [PATCH] base-files: exit if mtd write command fails during sysupgrade 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?b?UmFmYcWCIE1pxYJlY2tp?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Rafał Miłecki It avoids confusing situations like: > Could not get image magic > Image check failed. > Upgrade completed > Rebooting system... Signed-off-by: Rafał Miłecki --- package/base-files/files/lib/upgrade/common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 5f5c9dc8a3..2305bbea19 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -222,6 +222,7 @@ default_do_upgrade() { else get_image "$1" "$2" | mtd write - "${PART_NAME:-image}" fi + [ $? -ne 0 ] && exit 1 } do_upgrade_stage2() {