From patchwork Tue Nov 10 13:45:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397651 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=ZOqawtOp; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=h3Ymm//Q; 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 4CVq1q1tsyz9sPB for ; Wed, 11 Nov 2020 00:47:59 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZVCHyHUsmUy8oA2pzMD9zC6UCdJFXTwVC48xJhjkggs=; b=ZOqawtOpaN6UMRf/RVUFnfjAn S5tiBBuNJaUkARP86juBqwCZXTe8LBkxkhqMQ5DJ+XcKo2RT1WJKzUMG5by5WHO7ZdquiVo2kKfcX vrICAWv5DCbzjtchvPQyGTQykaJpeMo1goL+eC6Ra8NhAO5hFOEomK9ufbp7FghTaBpPJZHhrmag5 pfxbgzLKlPuuqaLNEUfHlUlnOaRLW/ujIxODEr7QZ8PSVHcoCxrSpcjCwI1tnFwSV8uWhhu+XXukj pZafUOZc3JdAPookLFpAfRKHVvMayf4uL9UU71g9m6IL6c1gOCTdOmKbQiHEnF7R21pefJ9G62ld+ K4Yg9wcew==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTya-00024e-U2; Tue, 10 Nov 2020 13:46:25 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyV-00022D-Gz for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:20 +0000 Received: by mail-pg1-x533.google.com with SMTP id m13so2040673pgl.7 for ; Tue, 10 Nov 2020 05:46:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cCIlxboU0GICX4QXDGl1X9OlSh21nBhDL7wj/5i4EQk=; b=h3Ymm//Q7snSncvh4QwkjXiCC0NDpb9ml4HrHE6SwtMHgCaWgTkE8FuL/WviA9bmec JYdnkza1ehJUtL+37vOP5Yro7JutOrjfQHmgjbxOwaar5d1QeXV27bo70oAhyofp9edu XYBpZ4MTURzBIxEpJlEUcEKa3ELUJgz5yPTLxgV/3riuAF7JvtOvH1YWzdMWLtiJvkl0 Nvm3H8Q1WuqDuM3VcTTwp9Mt9SZqDtoxwkJzFyj36Ov+4Tw7zf4SpVrHFbbgR7SQH0q3 HV3H7N4IINL9yeWJMHZU5aEDd8rsfY01KOacOLGaLvZu7/QlzEmAs+8PNJgL0a2tLKLw 5FJQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=cCIlxboU0GICX4QXDGl1X9OlSh21nBhDL7wj/5i4EQk=; b=mj7HTvgT6PCKWEKxeXXfLX72B6StJsB9CsmFrY33hQsI0nu496zk6JaUotxybMijHg cxlORnBFOpwOjgulVHcDjgrkmbJ72MHP7scUwrXerZv3y+9e++TM/6DCfr5OVuVSkOCr RgV3wthK2C+wl6MJkJmIWh44ne46QVMEgttcieNLPZVHhUvO0TuU+k+B+J5aCLBCKtqM UPJYFKydCGnIh4MldwB98OMdRIunjonfXxGY7ClbuI9Rtd9xJc+c7aMi1ypNKz03op+F R/S9ZnfL61sMo4/3bm+xLv53I63DnaRsthrH7240d4vfYPdXDAv+gHi0j8sorzW1PcrX y0yA== X-Gm-Message-State: AOAM5333DXQmHBqg1b5d7lOVwglPLiqYTbUsRAn+Vr+pR3Daxi0uJeCe +K5NBq7IGkjLIK4OKYTwI7o= X-Google-Smtp-Source: ABdhPJyogWpMp1dds0KCICO0Sipq3/9TncZTzyvtepkOn5Je3K94q5fqder7nQHkf6z4gG6FSFa7Ag== X-Received: by 2002:a17:90a:34ca:: with SMTP id m10mr2554595pjf.193.1605015977269; Tue, 10 Nov 2020 05:46:17 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:16 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 01/11] base-files: upgrade: log with date prefix Date: Tue, 10 Nov 2020 21:45:48 +0800 Message-Id: <20201110134558.7905-2-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084619_595549_5E072318 X-CRM114-Status: GOOD ( 13.05 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:533 listed in] [list.dnswl.org] 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org And log to stderr Signed-off-by: Yousong Zhou --- package/base-files/files/lib/upgrade/common.sh | 2 +- package/base-files/files/lib/upgrade/stage2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 2eb26ba44b..2ae83f5bfb 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -64,7 +64,7 @@ ask_bool() { } v() { - [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$@" + [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$(date) upgrade: $@" >&2 } json_string() { diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index a4fef42134..211a3f4b33 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -42,7 +42,7 @@ switch_to_ramfs() { mtd partx losetup mkfs.ext4 nandwrite flash_erase \ ubiupdatevol ubiattach ubiblock ubiformat \ ubidetach ubirsvol ubirmvol ubimkvol \ - snapshot snapshot_tool \ + snapshot snapshot_tool date \ $RAMFS_COPY_BIN do local file="$(command -v "$binary" 2>/dev/null)" From patchwork Tue Nov 10 13:45:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397652 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=rLNEQdJx; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=IQqt2M9c; 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 4CVq1r5slFz9sRK for ; Wed, 11 Nov 2020 00:48:00 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xOD1M19AMnpAWz3E6vNoOgirgJh9mhVtrfmoyfF/KRM=; b=rLNEQdJxSmwlYqeURJkwl6ZWF cEqITahNvsrzPcOmCk0QpJoRD751R058TdhzW5kqzDdjPEnskUHtaME2GtQpLyXJEq9SECF7A8Nqf 0mqC3p+ydmmoGob51F0Y5gIpJo+6LAHaN8UB3aE4STqGdYOYLzhjBLZpzIgnVS0b/7B1iT/EoeqiN IqFsB90KoPeWV4fHsm7K1nu2E5DKgzuLX1dg7IVfhmS+gRlpFSbVfmD1B7NE7XliIpY6ezNfWwlAL SUofHG4P6bvjSheAZw43pKchfmyUrBswCzQheKdGzLp4Q5UpDLrZNIAVmyTJ6bbObd5fGL8krBGVA 4EjAVp/OA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyg-000265-Ca; Tue, 10 Nov 2020 13:46:30 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyX-00022o-Ld for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:22 +0000 Received: by mail-pf1-x432.google.com with SMTP id q5so8498338pfk.6 for ; Tue, 10 Nov 2020 05:46:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ayzVFYEIqQcDgOObb/GGaRFsTfwoTlnw/ElU5+BN88o=; b=IQqt2M9cLV1UO0PX45vXQNAujJl9RmbPw+iHDYrAriFnddsDsZkRcFb59VAQ438UC3 3/KVDnAbfSC+0YnVoARmgaADQyN/C58oS+1BG3m2L6DeqX4+IzNdyZZFta6swQELEmxn URDE1qYerL4CVAGtjrk8AIzNn+ftBK2tjh+lMtMgfQpet0OWMCqoTTz/ofZUGQz31DpL W9xg7e3qdBuQF6ETB8CRjDtaV93ZnlrMOkLKKZ4Xd1lagJAaMm/E77OOmHCKx8ipYzol jXJFq4JBApR/mGqe0o3bOMa2TFodOjqoJnqIER0VB8PDy6zjDSaH3ltjFKJmDvIE82s6 2IwA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ayzVFYEIqQcDgOObb/GGaRFsTfwoTlnw/ElU5+BN88o=; b=chjXjhOqRfDY6rFcba3AMlnU+7HRQbTTbw76LkMVsu0G7/jrHvjkYa7x3U5MgBYn5D IXNfRUo7dwhwml66AM2Q+FL6zCoMVUbOWb9Exmt+rBxAFnnUfZBXFUXvtWz9zu5wyfBu +Mpaw1p6REKtzRroMcCkQIp0KC+AIC6FUjUoeGsL33mpM+EWUmAi/9yg1Ld2iPRHK+E4 zsI+bb5iNauyfdZVd0zk6UyD/zSkCpAbpHEW3384Eo4N1rGpjE3PKsLygxZEO5ybncCN I6Y3URMnk45nhVqbluJHSb58VeLmdwmU3nyV5UZeJR1yYbgIGTwPf857ZDlmr9dd6PR0 D/Xw== X-Gm-Message-State: AOAM530qvmm43YQevFB+8gqrdYB3SKW6XedYXIxK1VTea92qZQ3rGak0 ZUE5+akrJxldoI25yyvofoZuxquSRoA= X-Google-Smtp-Source: ABdhPJy6I51hIOk+CUOHUOVSkbrSIzYOeIumJQd7a8qQZZK76kPpsMcku43d8RIHlzAE8K9L9GV4dw== X-Received: by 2002:aa7:9095:0:b029:164:75c4:5d15 with SMTP id i21-20020aa790950000b029016475c45d15mr18344846pfa.49.1605015979493; Tue, 10 Nov 2020 05:46:19 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:18 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 02/11] base-files: upgrade: add vn and variants Date: Tue, 10 Nov 2020 21:45:49 +0800 Message-Id: <20201110134558.7905-3-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084621_767280_43164D95 X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:432 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org To be used with in the following pattern vn "Remaining: " for p in $xx; do _vn "$p" done _v Signed-off-by: Yousong Zhou --- package/base-files/files/lib/upgrade/common.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 2ae83f5bfb..0f25199365 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -63,8 +63,20 @@ ask_bool() { [ "$answer" -gt 0 ] } +_v() { + [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$*" >&2 +} + +_vn() { + [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo -n "$*" >&2 +} + v() { - [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$(date) upgrade: $@" >&2 + _v "$(date) upgrade: $@" +} + +vn() { + _vn "$(date) upgrade: $@" } json_string() { From patchwork Tue Nov 10 13:45:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397650 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=i7PmXsnG; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=XeduDtdj; 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 4CVq1q6fJXz9sSn for ; Wed, 11 Nov 2020 00:47:59 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5uuAfIqXnvU2Gbz9Ui69P/VoF7paSVXUfs3UU4az3ec=; b=i7PmXsnGbkxIV4z94ipe7zBo9 kUaJJME9vcSFkSLXQDzG56dgrhsr42ZKPlBnYCxO1u8nvwdp3NmwN5Uh0rg8VyQxI22IwQOMvQODU CP2E8aH3B33Xf+jBMPxOnNeZjXbJ82ofgP0A0bx9uKZmwo0fyQ8xQP1WXTBzaHJfd2t5pW0Dg2v4y G8GHikrGoK0QBitygvLgR4BZU4/R/NQEwXcCg4+TVaDoIKSuxgitnnWeBkSa5DQbey094MwDiul4U p7AiV+lsYswJQCaJQU7hpdGQLze5suWqgbf0bgQ+rKre52YaOZk+TkANURgy/K1yupllC+lxj8mKs E+A9qwYdA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTym-00027y-SV; Tue, 10 Nov 2020 13:46:36 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyZ-00023e-J1 for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:25 +0000 Received: by mail-pf1-x429.google.com with SMTP id v12so11450140pfm.13 for ; Tue, 10 Nov 2020 05:46:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ey1FPwfxfmnb9ZIczi1lCXDLK0/3ukFxCgpNEehV4kE=; b=XeduDtdje6Wj4aCQ5QMZGkXgnprrNz4sqrqb0bz18kWCCEI7S+z2GT3IgPx8HFHbVE 8+JFW27x6QKAlFYNAzbXT6W/lHNxnE93nxYn5rTXGSv0CRSJkRpkE3lqXBLwlVqMhl8o HqB5Kul1bJU/6uQLSm3G2T/nLeiCrMQoUvCvA++MGBRvf2z7y8NADKLvHQrKq3+1oWmx 0QSScm9aeirbgle71AcY7KYh/UYq4pEePUr9BBTZrc2fy6mndTHcj3w5uSLLPm3gI+uo nYKlIwLK87D3gLtDDaPIA9GVghO6aCCmCJkN2Ar+rvNJtssidlBgYb5laiBjRD5Jtv+6 Oxbw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ey1FPwfxfmnb9ZIczi1lCXDLK0/3ukFxCgpNEehV4kE=; b=a61UxqtekRl20+6UpwYgdzfZZQLCMBe/91JAmR+s+B5zOThDrWLvNPWSI1swGfoo0W vO1ewg49/oGkEGKmEmFPxHsQYw7QDP+/03enCAVzSGpWo0O6Ki3WOiD/q7ZAAlfIjyDK 2qY7guL4+0XZPyo1UlIxa25CBVErE7SDk7nF9LnZUa17CJExWVpoBM4CGS4C9Ii9ECpk 5X0vu0DM4gFhD+I9GtBYmchUHPBj7lptfZR/l32ye26Wd5nluA3psA/2GxDSZZHh1ajN 9QNGvvFHFy43hpCyUTXtNxQboWn5e31GeC3KNgIt4wjTAkDaB76iAS8JJTr4YMakvrPU BVQQ== X-Gm-Message-State: AOAM533/mRKzDWq7CQ4EUgZ+OeiYVme+m3htAyDsVuELLt90kEUoJl4M GtYRYwBwr50UF6YEHpATYeE= X-Google-Smtp-Source: ABdhPJxbLbknBy1E2/X0XjhrgHhjgaF6DMzhVVPbOObI1aXCmtZXybA1AIQxabRKTX6GzkiHWM5pEQ== X-Received: by 2002:a62:e70e:0:b029:18b:913e:9d1d with SMTP id s14-20020a62e70e0000b029018b913e9d1dmr18411881pfh.47.1605015981685; Tue, 10 Nov 2020 05:46:21 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:21 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 03/11] base-files: upgrade: use stdin redirection to replace cat command Date: Tue, 10 Nov 2020 21:45:50 +0800 Message-Id: <20201110134558.7905-4-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084623_700708_23B14012 X-CRM114-Status: GOOD ( 12.84 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:429 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Yousong Zhou --- package/base-files/files/lib/upgrade/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 0f25199365..5eb7b23a83 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -103,7 +103,7 @@ get_image() { # [ ] esac fi - cat "$from" 2>/dev/null | $cmd + $cmd <"$from" } get_magic_word() { From patchwork Tue Nov 10 13:45:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397654 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=riRVkChV; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MPlhfi7w; 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 4CVq1x1Fjnz9sRK for ; Wed, 11 Nov 2020 00:48:05 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4+tt0LfP+EqOzhYsKdnBPRXGiLIFs6rORtIg2kcZvVo=; b=riRVkChVK6eITgrB7fojXvGZe 7uELbhL3GUq2+fMdGVNQTP9vFidF+0EajA6Fs2NLKvO8TTUX3lV8z5tzpqnrc1gGLH8qVMioW6p9c 9Yju3ngJ45H3n2xRv2AL+pf2I104NXeOrZJuPrLyjboqKGFhPJvWPSXCc506xxueQY5i7xzsAzeAu 6t+drQ9PY2bRhDVYJL2C2YcsFaZutzBFe54MOE43OEuDWAlW6z9EJEI8fxqkDdqLfFoiLPnvCcRGG bWigE/i+sKIuYwJVopvkl8MnrtPyak6PhFU3bgRKLZNuuBK5uglPqBPHwLAzHu8IgS6B536dl4eaF zwfdzPZ0A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyu-0002P4-Sl; Tue, 10 Nov 2020 13:46:44 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyb-00024c-S5 for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:29 +0000 Received: by mail-pf1-x434.google.com with SMTP id z3so11451929pfb.10 for ; Tue, 10 Nov 2020 05:46:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zek7KsGXYmcHkPWzjWBGnNjdLcHec5hvx8HhgwfwgRo=; b=MPlhfi7wEjZx4v5w8mfchCtqrHmI0au16lFyGQLUKWp8yiIMmHuEKED0TH89rHBsnF OW3fictpl3MPI1PMoVLZldDa3On297Upb7ZK9FgxNDqi+og//lzOnT8iRGh8kmWF6HR4 HjnHGsj0S6G5ALTQO+GFK4r7Yq/VWAAEGO9Yr565cVVk/4CF8iRUObkSt5R3SowjZsRN 0Sg92WsCZkAZ2xlRvFVfP94iJuzb3a64E9EZ8OVGd3QzWLxXV7tAMX/03kBa7LxCROaV 9m5VSfJWGy/Mp9SF6rVRtlzgOtIz4jUaw+hCjGVy0ORPRg/6tW4s4F60Mq38vpOaMhLH ZYeQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=zek7KsGXYmcHkPWzjWBGnNjdLcHec5hvx8HhgwfwgRo=; b=PyAL/POBjelNvKCdyWYfjY2i0LsGY6DTg4jkOSlopT6mjawIT9qRS5GdfgDQyP9m2h YF7NjcMR+WmzVU6DNkh7wMJUDpdSC7AtgetS+/eh14r0A71/dFhWF+GouZumIbwf847n FBQE1vFz9RkkNiGX0M1tauTh8lBboBpeLtDSAh1g5BgIOgZEMBv7G6LfqdMcHsa9kF8K sCu3EjCnXxNWAvvgPRBZQJcKY20fjm0yHiSz4pBzlM4D9wiuExlYTA66xi4fKI5ox+5y ci3xjbyCj2KNFFKyLVv8GTBrAKmpt901oAu7CKavJvoYVXoGzpVzeBAIUZLqbeB34fFL +8Cg== X-Gm-Message-State: AOAM532p3Beh48glAenesRYKDIoGEDHxMM2bEVoyyiO3vDCSxPy+E6ps Tt94+oqYvaZ3BqJPhdoi1a0= X-Google-Smtp-Source: ABdhPJy/ShuvtVuhoM/YP2+BP0cCJOwIOaTpjcwPdm9jXHfyX926jVlr2FNJAgR2RMMi8mbkDOI8Kg== X-Received: by 2002:a17:90b:1094:: with SMTP id gj20mr5157885pjb.202.1605015983941; Tue, 10 Nov 2020 05:46:23 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:23 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 04/11] base-files: upgrade: add get_image_dd() Date: Tue, 10 Nov 2020 21:45:51 +0800 Message-Id: <20201110134558.7905-5-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084625_963745_3CEFA254 X-CRM114-Status: GOOD ( 10.34 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:434 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This is mainly to handle stderr message "Broken pipe", "F+P records in/out" by common pattern "xcat | dd .." Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3140 Reported-by: Philip Prindeville Signed-off-by: Yousong Zhou Reviewed-By: Philip Prindeville --- package/base-files/files/lib/upgrade/common.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 5eb7b23a83..a5c27dc2fb 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -106,6 +106,17 @@ get_image() { # [ ] $cmd <"$from" } +get_image_dd() { + local from="$1"; shift + + ( + exec 3>&2 + ( exec 3>&2; get_image "$from" 2>&1 1>&3 | grep -v -F ' Broken pipe' ) 2>&1 1>&3 \ + | ( exec 3>&2; dd "$@" 2>&1 1>&3 | grep -v -E ' records (in|out)') 2>&1 1>&3 + exec 3>&- + ) +} + get_magic_word() { (get_image "$@" | dd bs=2 count=1 | hexdump -v -n 2 -e '1/1 "%02x"') 2>/dev/null } From patchwork Tue Nov 10 13:45:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397655 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=rVRHD390; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EmupxtrJ; 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 4CVq1x5mk7z9sPB for ; Wed, 11 Nov 2020 00:48:05 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IOAxl7g4RzmAW2IRWc2q7Hs57T4aHMM/TfyP12/Rps8=; b=rVRHD390W5BRswXxYwli4JvwP HjyaKLiG7akkt7GdsWrYewUQYV0VjZuLkm0psfGpp2qhVI4S1mEFNq7yijudJQE5vOth5q3eGBeFO moY8sLL8YFeYMe5kaXcF2/k7kRmnZ8f2Zt/5lrjD4GRIAGtnbQd5497CPWRRqwJIMQ3o8mwNEFT1Y PoEa+Z9tEcEqsr2ZBKQuzp5KdEAGJ9ylPjKI5JNL3oO+REIIz818q0wvtcUvZr6caka8GNK4aferE u/qyA5bCgNoqe9j437ROtdRPqb1tQCG1ByzS0NShGwXiG1bYjFtCBKRewucmHP62y+I6YUniw6/wg Rh0jPN81w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyy-0002QV-3T; Tue, 10 Nov 2020 13:46:48 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTye-00025Q-6f for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:32 +0000 Received: by mail-pf1-x42b.google.com with SMTP id z3so11452032pfb.10 for ; Tue, 10 Nov 2020 05:46:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TvTxoNUzpQ5COO4nKiItdht5sRoLgILBVELULBnopiA=; b=EmupxtrJfMoai0mn+UZx+LRSFMrOjv53PO8DGNU//vfDnvzIeveNmZk05T0Ya7/ldD VyR5jRnYcbCrkUytpYiURLSgMteuJN+3u8iVaWWJ6PZ0rCxsnnFHVDKgjEjmJlDrf65v a2oVqU787BGPx2bbYJRM1WjNsEHODQjYlEgnDQT1Zp2DUNtHSC8ZW7952YLouPtJU4JJ HEbAFM0CDJyZSKBaJQan6uH32FRKXdN/Rgh/g2cTvkx0ZaRKF9SqS1Bx7Vz+R3nJmAcQ H/naqG8M6x/4wYEmKQh3kIy+aEXmQBJanB4d1qkN6lmUki++OqkIwL9O/vzgrzGWEeJn SzYQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=TvTxoNUzpQ5COO4nKiItdht5sRoLgILBVELULBnopiA=; b=f/+2JnroGRoqBTO8a1L5FLh+obXvdRmWf/CmuqYO0j9w+NoeN2XIXr/7U59CAeoeTO jmbOK4VeV0bzkKcpRYNtuPgFfJ1agqfWxZ42nACu16VDf6NxzpWjbU+sMuj+XifJ1WuQ PP/H4HdkyAqdN1RFWPXXKFSI0szh6bD9nEOUNuNc2ANSBR1ltkZS2YphVf0CxyAsrxCH roYhEu6oSiM1mhE8v/zH6eOfENFaKd+/hRYnSECE35dP1L9Rpd3ewtVUc5SOzT4ibxM+ rKet55W165iu0C0+uOwarCl18CUz82zau9NmrJum/+BbCPXsZ2EW371GRukHwLUz0bsx 2hDQ== X-Gm-Message-State: AOAM533yd65N2i1phPMMXHmDeAlPyPrVzSVTDQx6+7K4ELb0bdegW0Er QdHl4GTVI47Ubi7ln/2Nr6g= X-Google-Smtp-Source: ABdhPJwFVNY4s4EwAERWWpYDJq9+eS6psW4Ek7xfBARFjhjfQrgO6FgLioS4+CkEgoF2vcokWVubaw== X-Received: by 2002:a62:18d1:0:b029:18b:7897:579d with SMTP id 200-20020a6218d10000b029018b7897579dmr18367763pfy.10.1605015986187; Tue, 10 Nov 2020 05:46:26 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:25 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 05/11] base-files: upgrade: fwtool.sh: use v for log lines Date: Tue, 10 Nov 2020 21:45:52 +0800 Message-Id: <20201110134558.7905-6-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084628_340942_FC5EF360 X-CRM114-Status: GOOD ( 13.72 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:42b listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This will have at least the following effects - Log lines will have common prefix - They will be output to stderr instead of stdout Signed-off-by: Yousong Zhou --- .../base-files/files/lib/upgrade/fwtool.sh | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/package/base-files/files/lib/upgrade/fwtool.sh b/package/base-files/files/lib/upgrade/fwtool.sh index 3a74c72bba..bf3059dbce 100644 --- a/package/base-files/files/lib/upgrade/fwtool.sh +++ b/package/base-files/files/lib/upgrade/fwtool.sh @@ -10,9 +10,9 @@ fwtool_check_signature() { } if ! fwtool -q -s /tmp/sysupgrade.ucert "$1"; then - echo "Image signature not found" + v "Image signature not found" [ "$REQUIRE_IMAGE_SIGNATURE" = 1 -a "$FORCE" != 1 ] && { - echo "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" + v "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" } [ "$REQUIRE_IMAGE_SIGNATURE" = 1 ] && return 1 return 0 @@ -30,16 +30,16 @@ fwtool_check_image() { . /usr/share/libubox/jshn.sh if ! fwtool -q -i /tmp/sysupgrade.meta "$1"; then - echo "Image metadata not found" + v "Image metadata not found" [ "$REQUIRE_IMAGE_METADATA" = 1 -a "$FORCE" != 1 ] && { - echo "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" + v "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" } [ "$REQUIRE_IMAGE_METADATA" = 1 ] && return 1 return 0 fi json_load "$(cat /tmp/sysupgrade.meta)" || { - echo "Invalid image metadata" + v "Invalid image metadata" return 1 } @@ -64,15 +64,15 @@ fwtool_check_image() { if [ "$dev" = "$device" ]; then # major compat version -> no sysupgrade if [ "${devicecompat%.*}" != "${imagecompat%.*}" ]; then - echo "The device is supported, but this image is incompatible for sysupgrade based on the image version ($devicecompat->$imagecompat)." - [ -n "$compatmessage" ] && echo "$compatmessage" + v "The device is supported, but this image is incompatible for sysupgrade based on the image version ($devicecompat->$imagecompat)." + [ -n "$compatmessage" ] && v "$compatmessage" return 1 fi # minor compat version -> sysupgrade with -n required if [ "${devicecompat#.*}" != "${imagecompat#.*}" ] && [ "$SAVE_CONFIG" = "1" ]; then - echo "The device is supported, but the config is incompatible to the new image ($devicecompat->$imagecompat). Please upgrade without keeping config (sysupgrade -n)." - [ -n "$compatmessage" ] && echo "$compatmessage" + v "The device is supported, but the config is incompatible to the new image ($devicecompat->$imagecompat). Please upgrade without keeping config (sysupgrade -n)." + [ -n "$compatmessage" ] && v "$compatmessage" return 1 fi @@ -80,13 +80,13 @@ fwtool_check_image() { fi done - echo "Device $device not supported by this image" - echo -n "Supported devices:" + v "Device $device not supported by this image" + vn "Supported devices:" for k in $dev_keys; do json_get_var dev "$k" - echo -n " $dev" + _vn " $dev" done - echo + _v return 1 } From patchwork Tue Nov 10 13:45:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397656 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=G1SHH3Fc; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=qNwzTpvE; 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 4CVq1y6XVZz9sRK for ; Wed, 11 Nov 2020 00:48:06 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z1h9oBHoL4LLucfNYySjhCkrjroOilBP/aPMDvneSAk=; b=G1SHH3FcJvzSFm9o2CFNtXUJr 0KhHXwNSQfrsM5AHQYSdlmNNyNutvYaOq8FeqxdRDxTIJ554P4iZ2k0Sfu8CwENT7s8ghbEHBOYjD /Xcse0UC/Ho36PhvdyvRhKOUWgTuS2YlqUzTVDCMumyPLgAm32G2Y3GgE04Hpao7kqrsop+VM0/9R UBEQfSR5lbqZMTWK1pkGEVszsvhbx55Jzy4kB7onB52QAi5MyCIbB8e2G+Uqkg+IJeE15FWyGkRLl tkfXXkCY2VMlspmrPMDgRFFZ3vIDzDRIQwL7ZJb6yTdff4zphPDL3opveePrppxp4t6iDqBi5Rfyx M+xGvaPwg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTz0-0002RK-I6; Tue, 10 Nov 2020 13:46:50 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyg-000269-GH for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:33 +0000 Received: by mail-pf1-x42f.google.com with SMTP id e7so11453249pfn.12 for ; Tue, 10 Nov 2020 05:46:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WPjJovFaagzOvldrn3A7RY4rR2B6AeSYXI5VPYWdMWs=; b=qNwzTpvE3iam8x3lbHx8rS6ytnXFRunsdOwU2uGicwH4HDvBPMNhbfgwaR/Uie3BA4 ucIQu/GTepnzxzI8q2+GlC4N9pEAhu+ZZohlFh64U4GmPNKUr6u9f2ht2XIe8OMNGNtP sVToDuWtTilPO+H+1z0KVLI3HoepXoSPMAh1OeK7Ad5N141mnZF6UrEw1D2CiWB5Wt4k So2Dew1gWUoLt6NaVaJI0tm+91sC6y40KyjaAFDT9MvlXSsDmDnD5EpSAWcEKPbcdoVe ocDNKAjmfJqP2s8zXUf5tDMIEsIOyyF8FZTUIVUKJTag6/pGWC3RTlZsIokEtaaOIigF IweQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=WPjJovFaagzOvldrn3A7RY4rR2B6AeSYXI5VPYWdMWs=; b=L3a5RxE156sUevC7L6joDrpLpwO1hbOdXSrv49vudLhCu4BZwC54efXwqvNQwJZEbx Egm3IH7Z559W++qt7JU3G+5YKVUxiRhupur36cy75b+QKagKrbr8J49UG+ZNz4/L/bIT wxlR/m0yofSacc9LgEQntvzi8mpW84hEBKTQ8ZYPhRscXTa24Z/jrbw2eX14DkTnNkDZ QyoKCYFc8xd1gVXITCCFNPbgtG1iM8lG/7wuxbjMjjL77hsq4Uj5Lb/EygUaaOtq8Pc3 z1pPxP2Ipqd6swOoDadHA4oKZjDj8EQU8q/2ui37oSfbea5crfZGVg/PnMbvransrtBW xf+Q== X-Gm-Message-State: AOAM532EelGdFQ0t8qPqK0ps6mavUqZOlAx/3cp/7E+AncTeoHOSgJ4V hU7KtjRpquGJolYWrSCJt/41inK3ALk= X-Google-Smtp-Source: ABdhPJz6GTYdQ0r8DrNAtDQzStEG7WiJ0vmotogcFft4dZXdguK1YxIeIXq48JxDCacB30+6VEdD8Q== X-Received: by 2002:a62:924e:0:b029:18b:c60a:aaed with SMTP id o75-20020a62924e0000b029018bc60aaaedmr16388028pfd.52.1605015988491; Tue, 10 Nov 2020 05:46:28 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:27 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 06/11] base-files: upgrade: fwtool.sh: rewording logs Date: Tue, 10 Nov 2020 21:45:53 +0800 Message-Id: <20201110134558.7905-7-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084630_585725_FE05FB60 X-CRM114-Status: GOOD ( 12.86 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:42f listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The intent is to make it sound more like info level message, not some error like "404 not found". x86 target at the moment makes image with only signature but no metadata (ref commit f8141216 "x86: append metadata to combined images"). Signed-off-by: Yousong Zhou Reviewed-By: Philip Prindeville --- package/base-files/files/lib/upgrade/fwtool.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/lib/upgrade/fwtool.sh b/package/base-files/files/lib/upgrade/fwtool.sh index bf3059dbce..3826bf5c30 100644 --- a/package/base-files/files/lib/upgrade/fwtool.sh +++ b/package/base-files/files/lib/upgrade/fwtool.sh @@ -10,7 +10,7 @@ fwtool_check_signature() { } if ! fwtool -q -s /tmp/sysupgrade.ucert "$1"; then - v "Image signature not found" + v "Image signature not present" [ "$REQUIRE_IMAGE_SIGNATURE" = 1 -a "$FORCE" != 1 ] && { v "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" } @@ -30,7 +30,7 @@ fwtool_check_image() { . /usr/share/libubox/jshn.sh if ! fwtool -q -i /tmp/sysupgrade.meta "$1"; then - v "Image metadata not found" + v "Image metadata not present" [ "$REQUIRE_IMAGE_METADATA" = 1 -a "$FORCE" != 1 ] && { v "Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware" } From patchwork Tue Nov 10 13:45:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397657 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=saebp2tE; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=DaHhou52; 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 4CVq2K5Gybz9sPB for ; Wed, 11 Nov 2020 00:48:25 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3oTgpEn9ThgPLvdH8cPz0lFEavQh3rtrFXiq8INXKqk=; b=saebp2tE8PfK3QPNSCI+usFDt CQi/8Bag16IzRgDve1/OE48KxV7gmD21wn9cX8gzOVQO20rEfeNHzJz9LQOhSogzjBCupXGPQu3Rl LkM9j/IswwhmOaixhCQsg5KwtT2Wta5IYNhE3kBAyXtk8hudlSCzM3IhxaIRRpJ6kqTEM9AVFEYKS j9AR/jMvvIrzv0Fuw2Lyo0Fxe6jJ8C3hLSWZW4cag6oPcjTJINhF5+bteev0PjzcCpAgLKhfLjdqU IaTr0CL/nq7qmJxG87jjru1r/MAfHaLBDUBcI3l+fURF7G8Ec4qKQQpBWW0J/s+5et0EvPPdloZRR W8z8NgJxQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTz9-0002W9-R5; Tue, 10 Nov 2020 13:46:59 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyi-00026r-Cu for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:34 +0000 Received: by mail-pf1-x436.google.com with SMTP id c66so5759744pfa.4 for ; Tue, 10 Nov 2020 05:46:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hwLX/NKgW9BDDDjE7Tt8WNOG3rw+q6cokHS9lspuFIw=; b=DaHhou52lv+nysQk9GpgH0hofRl2mBA8WP6IUU0JQ7lKHGYhSyy5WSjBcpgEsnpZW3 hSP+f6zC6llQ1Au5ukzqgcwkUf3Z6asPIadFKVwdYFrWmZttmZCuwFzlQ2YbOBs4pmfJ oMb6K3Vu981FkQhAdac2N46PM83TuAL6eD5mrXIIxnChVcicXVhnarq+GWAuixNQg81a 4WY1oyzoSR0Mj7WtZ9CAKe0WVtR2jirDmBZqnHPbjvQjT0OWGgvImrC1YcRuze+RkC2Z fV/Empaxeze1NevGNzXz3at4w8daONpfHBNRA77KsZcQk+8IWHxqqd6R4LQHOIHirjaX 0/QQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=hwLX/NKgW9BDDDjE7Tt8WNOG3rw+q6cokHS9lspuFIw=; b=SjIz7waIIU+TF6QKkPa7ezGUhyvdn9uyCUmji1VssVsxj0JsFfGApUY7E3IeRXP+01 xMloWTlmawEL+rxqFtFXV2Qf61G3h4BRJc81peYPFPqumaSYRp3IkbVu8iQVzWqJuBip Z9AiI/SB/Z73FY0nFfwDvuWslXeGuhum6raHbndagq+sHXAdetKDweWYWI29YMsMWfNe FAqa+fKk4GegnI2KSLMKokr30/W3SxuufvmeYkXXM9U3Nll56wvbiDpIL5pKhOd3ngDu YNDFitnCfQPsqEWVx1Z95Fi9IqKyEGUmcYTXxgoW07+Hd5MjmRr/Nfi80BRcBLs8DrCq oJbg== X-Gm-Message-State: AOAM532qVzouL3s9TiMKuOBVP7xJB5giWVocPklmOq821OC9HTYy12CO u+hWwbsX/rB1BRtzIWKP1rM= X-Google-Smtp-Source: ABdhPJxS1Dhx20VcwNfWfBLzex+vvJ8265VK6fTEjNo9thhf1CKXCL4ykz8x73cTL+9/n9T9xYil5w== X-Received: by 2002:a63:c90d:: with SMTP id o13mr16635836pgg.289.1605015990727; Tue, 10 Nov 2020 05:46:30 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:30 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 07/11] base-files: upgrade: stage2: use v for log lines Date: Tue, 10 Nov 2020 21:45:54 +0800 Message-Id: <20201110134558.7905-8-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084632_506326_51AC1E0A X-CRM114-Status: GOOD ( 12.49 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:436 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Yousong Zhou --- package/base-files/files/lib/upgrade/stage2 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index 211a3f4b33..c7629c383f 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -53,7 +53,7 @@ switch_to_ramfs() { [ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64 supivot $RAM_ROOT /mnt || { - echo "Failed to switch over to ramfs. Please reboot." + v "Failed to switch over to ramfs. Please reboot." exit 1 } @@ -75,7 +75,7 @@ kill_remaining() { # [ [ ] ] local stat local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat) - echo -n "Sending $sig to remaining processes ... " + vn "Sending $sig to remaining processes ..." while $run; do run=false @@ -95,7 +95,7 @@ kill_remaining() { # [ [ ] ] # Skip kernel threads [ -n "$cmdline" ] || continue - echo -n "$name " + _vn " $name" kill -$sig $pid 2>/dev/null [ $loop -eq 1 ] && run=true @@ -103,12 +103,12 @@ kill_remaining() { # [ [ ] ] let loop_limit-- [ $loop_limit -eq 0 ] && { - echo - echo "Failed to kill all processes." + _v + v "Failed to kill all processes." exit 1 } done - echo + _v } indicate_upgrade @@ -129,7 +129,7 @@ if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then fi if [ -n "$(rootfs_type)" ]; then - echo "Switching to ramdisk..." + v "Switching to ramdisk..." switch_to_ramfs fi From patchwork Tue Nov 10 13:45:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397658 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=DoxzGv3H; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=dZplrMSz; 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 4CVq2M4x9lz9sPB for ; Wed, 11 Nov 2020 00:48:27 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ONrvZuNjxlK018ys+b6D4jBgy0CEfiD8zqYKmaBTRys=; b=DoxzGv3H91f8NHSdTnPsQ2UAd ZzicUrNulxuhsEVYWcil/7/JlI5kWddy1saujW15Y20S2X5X8swMwrvFmwnoPAnUp1PskvFudA54V tvqJFkeFclIHTkcid3/RBdDdvd411uCr74rv4Xl/SsSWZlWmJuIZcSNTjzIh4sZr5jktfdXZ2NI0R z43l8IDmsYb5rmEc2LtApBHa1lNEnrJThVJAbwWg+ZmHjTfWRXUehXc7OOAbzuM0tTydUDkO7dYWg FSE+ePL8ZoS2MJfzpQaIVM1KG/HdzI4pSFRZvqMd7vKM3WzbrAOTGhZtIEmGc/BKVh67S34LdxK+n Ndi2jlAog==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTzE-0002Xy-9z; Tue, 10 Nov 2020 13:47:04 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyl-00027g-4j for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:36 +0000 Received: by mail-pg1-x52e.google.com with SMTP id z24so10211451pgk.3 for ; Tue, 10 Nov 2020 05:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EZc48VUwd/JQfEPQQIybtaiO2DNM2QMbBs866KxHGDE=; b=dZplrMSzMQDJQLIJJEobPzTcOdlMLXHLKvq3oOZ/HuXYsHjJc5UKCc16EFQZO2aeX1 weROUDClGxKfW/BcuhF0AmXBAoyjsIwQLXhhebMzwcnZVnJEP+AfBWRep1lHaeDaCoo0 88gFDYSt63EkXCLFfAvzjFMdMTMAxQa6Gu5tXlUZi5fe8KuW2dwtOQw1NjNDoAVEayxp UgeqP0kOxIDSFqKT+78AKDKcBej98rSNxOAXRuqruAX59TfRJno+iG/wqf43T1lr8Jv5 UJKUTF+kaiIU5vTzVhqZPhhjr26FHqOWV1JXDVvJ8ujcTTEsIIeA9J4GLKrMJmxL5H5p w7HA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=EZc48VUwd/JQfEPQQIybtaiO2DNM2QMbBs866KxHGDE=; b=Pz2BCg2FFtjHV8vgpVQIRpEZvYRXRJ5UqJj514AyCew89UgC5NCCHEmdn3pCWrvnxZ tDH/XVEu1TZ8NzTskLXRVdpjIrjJ8x2UZK4dNlh6w8coV/Y60dqa1KiRA5PTgNfw2sHZ lEcx++lajV6/xua2kHlxDF8pWPNNS+13rVGtieIf2I5xHzogzdr4OwPDOkzxKtLCH65M 1MLQoyCgAF+YPNWlrz92chTYNlpMT09ABto+JwANNa0yRA2mqQv5UrPhZZN16BWDmDzY nlCAqX8vGxo/cEA9Cy0gS+V/Bf7eBirFi4q+xu6fCKS6tKYEpZLnfRBMdONC337XH7q9 VACw== X-Gm-Message-State: AOAM532XGekqAiC5U3NtR6BrHcp+fZVQDLLaNEyyCuwz+t1bIhmHMjLT tAfKnGRohhPYGHW/ZMVHDWerScr2L6Y= X-Google-Smtp-Source: ABdhPJw9ZmWZ5KV+ZCv+kSFTME7smth90B0HDwC4Q5n5Bzt/5FZX8m6f/rfavGXaoPG/kzhkbcCuWA== X-Received: by 2002:a63:7a51:: with SMTP id j17mr16741906pgn.186.1605015993098; Tue, 10 Nov 2020 05:46:33 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:32 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 08/11] base-files: bump PKG_RELEASE Date: Tue, 10 Nov 2020 21:45:55 +0800 Message-Id: <20201110134558.7905-9-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084635_220990_75E4F4BF X-CRM114-Status: GOOD ( 12.15 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52e listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Yousong Zhou --- package/base-files/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index f63c4db533..b546eb7e0b 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=235 +PKG_RELEASE:=236 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ From patchwork Tue Nov 10 13:45:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397659 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=KED3GGa6; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MNbF2aPV; 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 4CVq2P0Pyvz9sPB for ; Wed, 11 Nov 2020 00:48:29 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+5yPLG0KaChkTLjcV9VY4hnZ2wqYFK43f+MfUH1q1Tc=; b=KED3GGa638ZsKZiB2LhQjpedg PQfVofUoHnkHGBHAkUgPOn/MPK5NAC37MBtvN1j2BLBUAk9WPHWxQ4BVv4DRlbedIZN+yQ/vKCnhK 3MjjbcdnRq+/qqj9dLQRHO8VO0ixSa9JWJQyiYsFIFAHg/H5mq1AIL8Ni1/N2bYHUx+akocabYkns YUhO4Qkz4hVywjiRiTHDbLMzK6ZmqxTGc9u/rZecpCHpka8TeIFGymAcN6Ew8VvC+ETmF1iO4bM/5 wuGY9+TxZanX3qNChNuZHroqiCz+bQjJoMBrXI80nBk6VKWugZcSEQ5zJ8SL91J0luTGWkacwYjKx Pz+sjJZPA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTzJ-0002Zt-5e; Tue, 10 Nov 2020 13:47:09 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyn-00029t-Dc for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:40 +0000 Received: by mail-pg1-x542.google.com with SMTP id i26so10199629pgl.5 for ; Tue, 10 Nov 2020 05:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Fcl2JvQjiSLGcWeI3ykKVYR1QQesdP3Hk4YgYVnlVfo=; b=MNbF2aPVUG9ogfzHigvl+d2h+BbgmBidsHDFdkeKLGfo7v0Pf2S7qcWnuf1f2SW0BO gNQchl8nxjR2eTD3kVzO+U5QJCf1RoYiIB/H09AKYNWppdw73VLThf+n7dWK+HLCcyjz 2LytRULNWQ/+ghNYLVivILS7wZooMJ5Z/Dx1D/1SvTchCxydttgiPpLQuoQPDuC9qGBp TWJeLqK43U2YZNGqKdATe7Xw3yHWXhiOAQJLy03vLVKcY1e6hUxg9rKRFOn72Kg1CdAx NoSlXnX4igTmWYkgluxCJHDe8fo6LtZYFt/vO+IM3f9B8LjYqkfVx67H4+GYubJAQ3K4 vO4g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fcl2JvQjiSLGcWeI3ykKVYR1QQesdP3Hk4YgYVnlVfo=; b=Qts85vA5SU6OU7HIAUQbzFuQpTpu4TM5wrlpaPAOGKpWMpDK146oLYCfRycEhIO8PZ GoNW76MLtmxcWZ1mNxRBUfONsyjxt11ZveKrfisRxSH1grXWF7RgLQyqw0kKwxqrxIUr zytu0cMQ8NaOJfIQt2X4pahDz7n8QrkwupMzoL9pSgeaZHPTojkoCFxjDF7I/DOwaJGA 2ppzqTyEqWqT/fBJfO9hxvG8/gymnC6yFoENN2L9zItDo5SdCvSAWW95qoCZoh424z3p mdHAjNw0HP5oLjqaLTo2mSZP1hGfSOxi8bXhEFHKo9FoL8WRE8wgng5GmvISvZqBvQCp q+ng== X-Gm-Message-State: AOAM531eROwi3T3bN3/nskpyOoooPcYQ67FGI8AoZwmnQ8SXWCBB1pzG Z/wWhUswIEYDU3RpWN+wZwg= X-Google-Smtp-Source: ABdhPJyzlbjIzr4Prm298vYFV5pLEcjJzrF9RIjpjg8k95LCF5D4Upy8xMKajap+DW0qw/8NEM56jg== X-Received: by 2002:a17:90a:3f10:: with SMTP id l16mr5251463pjc.110.1605015995422; Tue, 10 Nov 2020 05:46:35 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:34 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 09/11] x86: upgrade: use v function for writting logs Date: Tue, 10 Nov 2020 21:45:56 +0800 Message-Id: <20201110134558.7905-10-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084637_507456_2736C24F X-CRM114-Status: GOOD ( 13.55 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Yousong Zhou --- .../linux/x86/base-files/lib/upgrade/platform.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh index 1bcd492dd7..617b267e68 100644 --- a/target/linux/x86/base-files/lib/upgrade/platform.sh +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh @@ -7,13 +7,13 @@ platform_check_image() { case "$(get_magic_word "$1")" in eb48|eb63) ;; *) - echo "Invalid image type" + v "Invalid image type" return 1 ;; esac export_bootdevice && export_partdevice diskdev 0 || { - echo "Unable to determine upgrade device" + v "Unable to determine upgrade device" return 1 } @@ -30,7 +30,7 @@ platform_check_image() { rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image if [ -n "$diff" ]; then - echo "Partition layout has changed. Full image will be written." + v "Partition layout has changed. Full image will be written." ask_bool 0 "Abort" && exit 1 return 0 fi @@ -57,7 +57,7 @@ platform_do_bootloader_upgrade() { echo "(hd0) /dev/$diskdev" > /tmp/device.map part_magic_efi "/dev/$diskdev" && parttable=gpt - echo "Upgrading bootloader on /dev/$diskdev..." + v "Upgrading bootloader on /dev/$diskdev..." grub-bios-setup \ -m "/tmp/device.map" \ -d "/tmp/boot/boot/grub" \ @@ -73,7 +73,7 @@ platform_do_upgrade() { local diskdev partdev diff export_bootdevice && export_partdevice diskdev 0 || { - echo "Unable to determine upgrade device" + v "Unable to determine upgrade device" return 1 } @@ -107,15 +107,15 @@ platform_do_upgrade() { #iterate over each partition from the image and write it to the boot disk while read part start size; do if export_partdevice partdev $part; then - echo "Writing image to /dev/$partdev..." + v "Writing image to /dev/$partdev..." get_image "$@" | dd of="/dev/$partdev" ibs=512 obs=1M skip="$start" count="$size" conv=fsync else - echo "Unable to find partition $part device, skipped." + v "Unable to find partition $part device, skipped." fi done < /tmp/partmap.image #copy partition uuid - echo "Writing new UUID to /dev/$diskdev..." + v "Writing new UUID to /dev/$diskdev..." get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync platform_do_bootloader_upgrade "$diskdev" From patchwork Tue Nov 10 13:45:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397660 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=ZPE2WD/N; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=alD/I8+3; 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 4CVq2S4qg3z9sPB for ; Wed, 11 Nov 2020 00:48:32 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=liO7BWKePv1IXib0R+R04VXfDzAIqL4pclJhW/KdJbI=; b=ZPE2WD/N/6B8Cnl1Nm/aa7s7z k3gOCjBozURhqMecntBaje4tU7Dl58mogHeN6DpRCDbj3siAhuTrsCXuDRo8ZDaQ6Kj3o1NWatLv7 DhoastZdUklLYn9Fgmlc5c1O1CpigVa5lOYwgSXayzIlRVbYkiKeBpF76uMoOu3Tpe3Gl/3tw5qsV RcesTY2g19PwevIw9qMRS/Vl9p3BP2iepEX2oC9NDASyYUXLp6LkCvccovnQjXSKIzzFZq69hGiLW Yt2t2s6ggrAmkVyNtXRST/DCLQ3YgR8rGJlA3PzH9DwB5xoQURdBSsvLnfnUQSX31CX1G5LCNA5iF zlmMgsO4Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTzO-0002cb-RF; Tue, 10 Nov 2020 13:47:14 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTyp-0002Dn-HU for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:43 +0000 Received: by mail-pf1-x441.google.com with SMTP id q10so11489705pfn.0 for ; Tue, 10 Nov 2020 05:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yacUHKKfjmck5cTCAA6En5tPBHMrJh0S1vVweiv+7Bg=; b=alD/I8+3HjesAvHu+tBRT0Dc6nn1muOHFbc3wcbj2yyk82xcg5Ni4RW8PJiFDAetVy YxY+ENFQ+/ekSTagGnJY8HXWo+SXfAqMeGjujfNF03ZBGLgv3jZLSfqKgsaoq5CsOt4C 9IHVv1GY/Xx1UbYA2sPU/GJYdjS0M/Cd3PhGcZozuSMVZTInsJEFrMfNENWo0JnQ7N84 zTg2C6gpMny8fE39z6G6BA+RKu2/FFWnPK3fUyrAtZMfMNXppvA3BuWFwFjhTWX9Z9s0 UQHym5RT6l81znHF+GEoVJ/pmUBkIZ5pTqphkzYSlnOvUr5EZGgY7jYkXkpRdEwk8HCn ijtw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=yacUHKKfjmck5cTCAA6En5tPBHMrJh0S1vVweiv+7Bg=; b=igoewbfnklRBdEwH/o+RpH7G19U2i7LzW1wwBUxX5t/dOsAW7JbAidYyEpIDdtAEm0 nN3nmAS5iBxWHMWyH9HkHPkelzt4djEkz4dZLv2V5TiW+PTEw4a/itNvgEJknNdGlxRT ZkDrs8ReCtjSKvOajXo5XB6wpPb5GpLbXekGtk6fAEY89j2KXUV/AVbnArhuZLm5QqtZ k6uaR5APGXooGalXM5v6/ivy87YTQvY4mkQ0550zN9Vh7SFu2zqytCjVamwk3t/A3al8 B43RN5kgOsNPtPLdU8KX/+nC76/hH0w31Esd3R2UUGFf8EhZhvPw6tKHJ9/2GYy+JluY wL0A== X-Gm-Message-State: AOAM532dvlqQBnRjr6JMDiI2fWEvJtHVk/GYSNXpDafrkXyHIUwb8ZBh p2eL6Z2yXTA2qqnJErbbcO0as7hvY0s= X-Google-Smtp-Source: ABdhPJyTdljFODNxMsA+nWO+VXSyLYem0WC4m+n/rdUyRt07lwM6yuDsgH89KJsFT24piYplrks+XQ== X-Received: by 2002:a17:90a:5916:: with SMTP id k22mr5467630pji.146.1605015997745; Tue, 10 Nov 2020 05:46:37 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:36 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 10/11] x86: upgrade: use get_image_dd Date: Tue, 10 Nov 2020 21:45:57 +0800 Message-Id: <20201110134558.7905-11-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084639_680409_ECDB3FCB X-CRM114-Status: GOOD ( 13.09 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3140 Reported-by: Philip Prindeville Signed-off-by: Yousong Zhou Reviewed-By: Philip Prindeville --- target/linux/x86/base-files/lib/upgrade/platform.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh index 617b267e68..0b54caea29 100644 --- a/target/linux/x86/base-files/lib/upgrade/platform.sh +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh @@ -20,7 +20,7 @@ platform_check_image() { get_partitions "/dev/$diskdev" bootdisk #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=63 bs=512b 2>/dev/null + get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b get_partitions /tmp/image.bs image @@ -83,7 +83,7 @@ platform_do_upgrade() { get_partitions "/dev/$diskdev" bootdisk #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=63 bs=512b >/dev/null + get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b get_partitions /tmp/image.bs image @@ -94,7 +94,7 @@ platform_do_upgrade() { fi if [ -n "$diff" ]; then - get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync + get_image_dd "$1" of="/dev/$diskdev" bs=4096 conv=fsync # Separate removal and addtion is necessary; otherwise, partition 1 # will be missing if it overlaps with the old partition 2 @@ -108,7 +108,7 @@ platform_do_upgrade() { while read part start size; do if export_partdevice partdev $part; then v "Writing image to /dev/$partdev..." - get_image "$@" | dd of="/dev/$partdev" ibs=512 obs=1M skip="$start" count="$size" conv=fsync + get_image_dd "$1" of="/dev/$partdev" ibs=512 obs=1M skip="$start" count="$size" conv=fsync else v "Unable to find partition $part device, skipped." fi @@ -116,7 +116,7 @@ platform_do_upgrade() { #copy partition uuid v "Writing new UUID to /dev/$diskdev..." - get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync + get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync platform_do_bootloader_upgrade "$diskdev" local parttype=ext4 From patchwork Tue Nov 10 13:45:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 1397661 X-Patchwork-Delegate: yszhou4tech@gmail.com 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=gmail.com 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=SkpnUJIG; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=a/6TVVo3; 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 4CVq2W419pz9sPB for ; Wed, 11 Nov 2020 00:48:35 +1100 (AEDT) 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:Cc: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:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NDjr8WVwnw/XDsV645RXY6QB8f1buLUPGcXWaI4wTvc=; b=SkpnUJIGvYG+NHxyntMjf/H4u dKoTptuvGQbdd5NGMWWLfAmUdKms4Cs+EXyJ8DynJ/42NbgeTBh/PU6qdA1QnwINZQXo5Rdj3bz0D hWqa7R9o9/bgklLIXRam1Xoa7edxnflS7l0Vvjid1/p1joBrQlmQF3QF9b2oho0OU76flNWLaPnFw m9f2E6emQia82lSqvUCvUMPDlDu3eD0jEiLaO1yRptHCbIAzgFPsa/b7fQZkL8MEmm8QVvufBtxXs oP6h/x9kK9SKnVvpklR27w+9nQueTtn8XvR3G0eeFOx2AhiToA1pqKPeYl0pVn5qM1B76t1pOUbTo ExMoNsjLA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTzT-0002fh-9x; Tue, 10 Nov 2020 13:47:19 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcTys-0002Hg-4O for openwrt-devel@lists.openwrt.org; Tue, 10 Nov 2020 13:46:44 +0000 Received: by mail-pl1-x642.google.com with SMTP id w11so6501894pll.8 for ; Tue, 10 Nov 2020 05:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=88rduSa4YDTMVA9xOmFNy7FIUS1w8K7Lo6KkIblnxYU=; b=a/6TVVo3lTnXyjJii5nmQzFTOYt/n9oNR278KdIg8l0aMu7ap9FYaF/Zoqt60RbWtM odIuh7HXGdmERI2Y9wfhSUwtc06QA07hiV5F/6hvsGQAqbBojRj1arwCI88Rh7Lf/Juk zOr2PBlngAgU3gUlPqVXYTDRS3gL4ADklqiLHn1rMu8T0CiHyc20mpzJoYPSkUS4PLzQ Qu/TWEBamnFOTcW9WPPV138XX0jEegPXL1JeDGQQsNS2tTumxjv58XQex1xEyPDM/5vE rYGUGUN+0HvMmz7K+EfolefqO52dewjZRyLhAiEykPkJwt1FW6JGy2l8Pn8iNbh7Y4En aKxw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=88rduSa4YDTMVA9xOmFNy7FIUS1w8K7Lo6KkIblnxYU=; b=q5lFh2zyqGG9WiQOMAKDKCSg9P/2EoCZDIHiZSEEt4HKL9dhwy6hgX+SUwMsT5PNsh lENgPjs0mJLlnCD9gYn/tYECdLoyElvYDgyFl6bMYikY67OCDEgLw2UhjQrmLxX/BSK2 xPt1s7pWzBfzI4+osNfpoTpES0t5LTkC1cTuRApB4fIfah8f/j7OVt2MiUO2+YdJtgN5 J2NA9a0ghxWliDfr8bwVTM7sdVpn6PZgXF5ntHfMI7guh3RlWWFCWRitDwjMmCOhYYNI mVCM8dFu2NVxT/fatJE+VizwAiV+J8BAVb0R/L+raQN378Yvkj79BSmATej+KAJMjUhW uf2Q== X-Gm-Message-State: AOAM530B0ax6iIEQnowZGkdr8tVVo0yXjGJcfBuLjYIxXlI+Cxp0kmZv 5OgNeWWKfN29LRBe41zfQ3I= X-Google-Smtp-Source: ABdhPJyjtvJVRC0kGAyDkiHBeS5JdgVLhK2yfvHdsOUJrUYHGNuRo4SNsgV9iHjFJ5UgEK1caaFS+A== X-Received: by 2002:a17:902:fe0f:b029:d6:9fa1:eee0 with SMTP id g15-20020a170902fe0fb02900d69fa1eee0mr16436927plj.24.1605016000002; Tue, 10 Nov 2020 05:46:40 -0800 (PST) Received: from titan.office.yunion.io ([103.119.177.162]) by smtp.gmail.com with ESMTPSA id h68sm14605101pfe.74.2020.11.10.05.46.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 05:46:39 -0800 (PST) From: Yousong Zhou To: Adrian Schmutzler , Philip Prindeville Subject: [PATCH v3 11/11] x86: upgrade: make code comment appear as log lines Date: Tue, 10 Nov 2020 21:45:58 +0800 Message-Id: <20201110134558.7905-12-yszhou4tech@gmail.com> In-Reply-To: <20201110134558.7905-1-yszhou4tech@gmail.com> References: <20201110134558.7905-1-yszhou4tech@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_084642_225902_32ACD9C5 X-CRM114-Status: GOOD ( 12.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:642 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [yszhou4tech[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Yousong Zhou , OpenWrt Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The comment content can be useful for readers of both the log and code Previously when dd command "records in/out" messages are not filtered like now with get_image_dd, it's not clear that these messages are for extracting boot sectors. E.g. Before == upgrade: Reading partition table from bootdisk... 37+26 records in 37+26 records out == upgrade: Reading partition table from image... After == upgrade: Reading partition table from bootdisk... == upgrade: Extract boot sector from the image 37+26 records in 37+26 records out == upgrade: Reading partition table from image... Signed-off-by: Yousong Zhou --- target/linux/x86/base-files/lib/upgrade/platform.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh index 0b54caea29..d8f2eba97e 100644 --- a/target/linux/x86/base-files/lib/upgrade/platform.sh +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh @@ -19,7 +19,7 @@ platform_check_image() { get_partitions "/dev/$diskdev" bootdisk - #extract the boot sector from the image + v "Extract boot sector from the image" get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b get_partitions /tmp/image.bs image @@ -82,7 +82,7 @@ platform_do_upgrade() { if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then get_partitions "/dev/$diskdev" bootdisk - #extract the boot sector from the image + v "Extract boot sector from the image" get_image_dd "$1" of=/tmp/image.bs count=63 bs=512b get_partitions /tmp/image.bs image @@ -114,7 +114,6 @@ platform_do_upgrade() { fi done < /tmp/partmap.image - #copy partition uuid v "Writing new UUID to /dev/$diskdev..." get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync @@ -129,5 +128,4 @@ platform_do_upgrade() { sed -i "s/\(PARTUUID=\)[a-f0-9-]\+/\1$4$3$2$1-$6$5-$8$7-$9/ig" /mnt/boot/grub/grub.cfg umount /mnt fi - }