From patchwork Sat May 13 19:56:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 762077 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 3wQHkM0FRYz9s9Y for ; Sun, 14 May 2017 05:59:55 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IjaaSNtJ"; dkim-atps=neutral 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date: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=8zLkb/j8l9bTB250GvEyEbWJH+u32REa4yjfWnr8gyk=; b=IjaaSNtJihuriRkK3ERxPHVmKK dEGv5YQgy/JZM4Y0PI0OxlSHlALzoT1o3orwjSPlI8xHquq+UVFHbmIjdguPtuECSB4DQU0U+cPUE 6BxVIUoCZykfkzubI0rb4lxmF+XVLRz68iAqnosyrV6/s3SeYSGaYXjP2uDQAJD9J5a6lOVlG0nkw tPT0a/tOe6hlX1hbIIaqCISU3JM8GkotajKgmBjDvnJmFeHiGKB0JbH/i7h87k813uKRkfqwy+rw8 fBl/4T0TPDSmz/It7JWCLeeBigPbM5DVuAKuL9Wlu7ZmduHdM+OHiji8ZwwXykPdS/KnpANiB6jM0 nMCzSj/w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d9dCh-0006zZ-Kx; Sat, 13 May 2017 19:59:51 +0000 Received: from chaos.universe-factory.net ([37.72.148.22]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d9dB3-0004P9-Hb for lede-dev@lists.infradead.org; Sat, 13 May 2017 19:58:13 +0000 Received: from localhost.localdomain (unknown [IPv6:fd1b:c28a:2fd6::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by chaos.universe-factory.net (Postfix) with ESMTPSA id 98B90186CA1 for ; Sat, 13 May 2017 21:56:58 +0200 (CEST) From: Matthias Schiffer To: lede-dev@lists.infradead.org Date: Sat, 13 May 2017 21:56:48 +0200 Message-Id: <18a77822b59f31a3edb928861c18cd1035a1b3ff.1494704975.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.13.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170513_125810_160984_01A1B468 X-CRM114-Status: UNSURE ( 8.26 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH v2 18/19] sunxi: sysupgrade: don't write partitions twice X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When existing partitions are retained, the dd call writing the uboot image in the space before the first partition was accidentally writing the whole image, making the code for individual partitions redundant. Limit the copy to 1016KiB (the first 8KiB are skipped, and the first partition starts at 1024KiB). In addition, conv=notrunc is replaced with conv=fsync. It seems this was an oversight, as notrunc doesn't make sense for block devices and all other dd commands use conv=fsync. Signed-off-by: Matthias Schiffer --- target/linux/sunxi/base-files/lib/upgrade/platform.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/sunxi/base-files/lib/upgrade/platform.sh b/target/linux/sunxi/base-files/lib/upgrade/platform.sh index f2cd970d42..776bdf53bf 100644 --- a/target/linux/sunxi/base-files/lib/upgrade/platform.sh +++ b/target/linux/sunxi/base-files/lib/upgrade/platform.sh @@ -43,7 +43,7 @@ platform_do_upgrade() { fi #write uboot image - get_image "$@" | dd of="$diskdev" bs=1024 skip=8 seek=8 conv=notrunc + get_image "$@" | dd of="$diskdev" bs=1024 skip=8 seek=8 count=1016 conv=fsync #iterate over each partition from the image and write it to the boot disk while read part start size; do part="$(($part - 2))"