From patchwork Wed Dec 21 06:21:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 1718150 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kz6m3H4w; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=N7neqr7g; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NcNhy6Y5hz1ydb for ; Wed, 21 Dec 2022 17:25:05 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=40+yGjlez3re1WlShUOiXDNNqiJjSNzaskMqOk/z8AI=; b=kz6m3H4wXaURE1 3SIAPP5oJy44bmCY5WhWtpT/6GG7iiWcBba1w8q7B9vZaPnfprzbGNaqWyBuvHkgVCeouhUIJASTd J8mWlgIWr/NfZkqnaO9f38oRY3w1vQcYlG40BqgacKIUSSbK9/Vf9JollQmZmxXXqj6hmdBdvmUZ2 ozkFJWGGvel3fPthwm0vSA+HOj3pUF/uyINjULccgAHBy2uXoe0wcnhZAi65ZarFczLMLc0G258kc kl3nGRQVIsznWCIUsWyWg3TrVfZjiNbWal4I4z30q0nHrePhv714kgc/A0Gu/ngoMskmnjgxEqzOv eV7LmzI9N6B68PQrJRfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7sUL-00Abys-3s; Wed, 21 Dec 2022 06:22:01 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7sUC-00Abt6-84 for openwrt-devel@lists.openwrt.org; Wed, 21 Dec 2022 06:21:53 +0000 Received: by mail-pj1-x1031.google.com with SMTP id js9so14751861pjb.2 for ; Tue, 20 Dec 2022 22:21:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zSRmraLl44dWtoGM7VICr/ExnYb60xi6bOxGvilA9wE=; b=N7neqr7ghMchD7ZkXsNbZGETrNjDi253yKUhneqLmSP6mwQ4di4O6waIeJpe0qjQvP xCciVDCpl70m3Y8UI9/1snczX+isUQTJ9uKRzRNZakHSJm9Ln/nKJ3r0ZcF5X+EYWPtj 828QXAua426byLzBZSOi3X418gPzjzwcE+8j1MOtXFgIIm/Ji4JwQp5yXmPBKSf3FZwm b7HVUWakxTnoBGmAqeNcSVvx+5JBgb5UKCOr/a8NXi8Va0yswaOHC9nuTHntDhEgRIVX t33uDoKnXRlSNsQgu4KguenjENPVZ06XAdMAzYJr/Ow+PCIJMY9/qGs+VGUB0NOU9v6J DTzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zSRmraLl44dWtoGM7VICr/ExnYb60xi6bOxGvilA9wE=; b=D54V11JEKmxL2zWZpjiQv+NhABXj5NeOekgrNUDfb92KdGZAbKB6dShRKzNcZuz4eS I6fM5mAxhTPPQ16Rdm58234RdWHn+iEtoXw3lMOE+eTVZ/zbh4HliFizRBQ81Bv7IAqQ I09N981DW5qGirBWEZROqyajtNu8w8avexhDs37Z/UH5CojPsQt99pvrTXB+V7i9YaCs PuckRAXX6Uwiu6Fv+DQN/7VpaGfFbSEXOX6Fm+xsai+5sQKnzFLAarbSdV5iwYK+/1Yg uEXcUPSiov80PgJMCXdPQlNdhX2QInTHZ60stNvGP11VFr9EVQs5nqitfjQPINjGdqFY MxCA== X-Gm-Message-State: AFqh2krhdh/La4x5BsULO/oVnQer4rKShq/IZR3ff16VSOhBywWLlJXK ypCp82AQrdnlVl/XOhSJxg1VNjnJ92c= X-Google-Smtp-Source: AMrXdXt0LsQYQpeIL9h9n1a1trKp5VFouAiVGFhL0+puXCivKfEs2b3vDyvQsTQEEmEHzlfxTqIPrg== X-Received: by 2002:a17:902:9897:b0:189:acee:7aa4 with SMTP id s23-20020a170902989700b00189acee7aa4mr701767plp.65.1671603708998; Tue, 20 Dec 2022 22:21:48 -0800 (PST) Received: from localhost ([2600:1700:38c1:1d7f:f66d:4ff:fe3c:3ceb]) by smtp.gmail.com with ESMTPSA id h9-20020a170902f7c900b00189ec622d23sm10515587plw.100.2022.12.20.22.21.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2022 22:21:48 -0800 (PST) From: Brian Norris To: openwrt-devel@lists.openwrt.org Cc: Brian Norris Subject: [PATCH] base-files: upgrade: Fix export_partdevice() quoting Date: Tue, 20 Dec 2022 22:21:46 -0800 Message-Id: <20221221062146.1955285-1-computersforpeace@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221220_222152_444289_7C9AD968 X-CRM114-Status: GOOD ( 11.20 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: $BOOTDEV_MAJOR may be empty for many of the uevents parsed in this function. This condition thus tends to fail benignly (we just skip to the next device), but it can really clutter the stage2 sysupgra [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [computersforpeace[at]gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1031 listed in] [list.dnswl.org] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org $BOOTDEV_MAJOR may be empty for many of the uevents parsed in this function. This condition thus tends to fail benignly (we just skip to the next device), but it can really clutter the stage2 sysupgrade stderr, since it looks like the "=" operand doesn't have an appropriate left-hand argument. Signed-off-by: Brian Norris --- 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 53b8865a5788..af1182cb16a3 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -232,7 +232,7 @@ export_partdevice() { while read line; do export -n "$line" done < "$uevent" - if [ $BOOTDEV_MAJOR = $MAJOR -a $(($BOOTDEV_MINOR + $offset)) = $MINOR -a -b "/dev/$DEVNAME" ]; then + if [ "$BOOTDEV_MAJOR" = "$MAJOR" -a $(($BOOTDEV_MINOR + $offset)) = "$MINOR" -a -b "/dev/$DEVNAME" ]; then export "$var=$DEVNAME" return 0 fi