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