From patchwork Sat Jan 7 02:04:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 1722640 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=VMTwHZ0R; 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=Z6+oYqEk; 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 4Npk8f154Kz23fs for ; Sat, 7 Jan 2023 13:06:26 +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=clSk2oBjLM6N0PVErg+zGKh6XJ0KPXjPPn7H0Oi2lCU=; b=VMTwHZ0Rli2UnE Ts8Rn1FWAjKofZeVzKhZdI4tp4HkKXYrltaCXSSc6L0w6dxpEPS3qjao66KapGBcnNvMLRjFyU+SD nzmCdXJ+ZqZwxkM/yhQmzO/37KbwnrKlhf3hGhBinO11G7BQXfWHA1c17Kb4p1kksJw6sdQkyN834 NmM5VCNh1PKFE0dEgJmGJx8Zyy/PAX09w/nLbvyHgWa0jUitR0Fk+DzwAA6Ht8Hr6LS/VLg523pOJ g3eng8+Xy9D1CMGjFxZtwxzs9/j3OtZjd6EOxXeDo0hI+7RwMkPpWN+lEr0gQSf9/yXLJ2BVOYkv4 E128n8t7lwzE7ABx0HqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDyZX-00GVQt-Jp; Sat, 07 Jan 2023 02:04:35 +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 1pDyZT-00GVL8-VD for openwrt-devel@lists.openwrt.org; Sat, 07 Jan 2023 02:04:33 +0000 Received: by mail-pj1-x1031.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so7069445pjj.2 for ; Fri, 06 Jan 2023 18:04:27 -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=R3rPlew7uVo2JZKRVf0JNR2Z6NOiSX3017ih1UALz0c=; b=Z6+oYqEkWAAGFgcKrgDTud358wc6K8VkolhDU169JwlZ0fDjiIxYezcqm27weNoSd6 X6Ca/b5VvqEL2bW8S+UZPrZKuPeB1qBFF//FsQqG9OhUowCczLzUODYP7s6p1IKL2foQ yHF9FYQbYdLn3YtGDBuygpS21ifxTHWZlK8pJeEpVqHM9BCbD03JyKYw82M6EKp0WWP/ 38+NfTZM7eZrQing0iYHTE5ypE0kgdv1U/Dq8wdau5D3NBhsW/rgwQPDSe+CDR5Rtoz1 nU6vKR4cKATA/1HlCgkDOWjYcGseAc8T+149gICfhRwDufgI5eojl9f2lOwukW7bReDO GoHA== 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=R3rPlew7uVo2JZKRVf0JNR2Z6NOiSX3017ih1UALz0c=; b=YXYaNR/W12C4bTJ9zXgof+6wTLAN5+kAihU4VndTx7UtB/7dEpPVV3MS/oi9a0ZvaE 5O0JCHVov17lfYgSNXOss8w2EDPMpR4af9rnjSxGsPd5ygPzukTQ6Q6OPRzvlfBwiaXX V8chwlhyhc9+3P/VUOKU2bbQW0DpbtCptMhxuFSrcNFcn7os2SMb3gKIdKIOLamEPrRP +H4SbsSvXy6vzhVnuGWfB916uSEmg6y/+NtrFfwtnW1l0/MOSBSrC1vcUMkDiKMMJpP9 FCG2xPxtDY0spb+gbywjhb/yfF7/mftZKglJYyeV5Zd7yteCKgBmUSNpkIRMfgObWsUh lMnw== X-Gm-Message-State: AFqh2koQQbK+IOw/UzrGm4kMYKrhfh8ZqWhTq7EbgSDojwCGj67/QB9j R5n7KBtcMhmhaso6iB4wzIORb1s8Y0E= X-Google-Smtp-Source: AMrXdXvvo8FgG17EDfadnZt3SAYEJdKPO7kVq/poCm0hlyvSQdHCSeS76xkIN/3e839rq7xQPO7Wkg== X-Received: by 2002:a17:902:d887:b0:185:441e:2dda with SMTP id b7-20020a170902d88700b00185441e2ddamr76572463plz.44.1673057067252; Fri, 06 Jan 2023 18:04:27 -0800 (PST) Received: from localhost ([2600:1700:38c1:1d7f:f66d:4ff:fe3c:3ceb]) by smtp.gmail.com with ESMTPSA id j1-20020a170902c3c100b001891ea4d133sm1616159plj.12.2023.01.06.18.04.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2023 18:04:26 -0800 (PST) From: Brian Norris To: openwrt-devel@lists.openwrt.org Cc: Brian Norris Subject: [PATCH fstools v2] partname: Ignore root=PARTUUID... Date: Fri, 6 Jan 2023 18:04:22 -0800 Message-Id: <20230107020424.1703752-1-computersforpeace@gmail.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230106_180432_046700_F2FF0840 X-CRM114-Status: GOOD ( 11.52 ) 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: We're assuming all root= arguments are /dev/ paths, but many targets utilize root=PARTUUID= strategies. At least allow them to fall back to scanning all block devices. Signed-off-by: Brian Norris --- 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 We're assuming all root= arguments are /dev/ paths, but many targets utilize root=PARTUUID= strategies. At least allow them to fall back to scanning all block devices. Signed-off-by: Brian Norris --- Changes in v2: * fstools, not fsutils (sorry for the noise) libfstools/partname.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libfstools/partname.c b/libfstools/partname.c index f59c52eb8f3c..9c27015643ad 100644 --- a/libfstools/partname.c +++ b/libfstools/partname.c @@ -128,12 +128,12 @@ static struct volume *partname_volume_find(char *name) return NULL; } - if (get_var_from_file("/proc/cmdline", "root", rootparam, sizeof(rootparam))) { + if (get_var_from_file("/proc/cmdline", "root", rootparam, sizeof(rootparam)) && rootparam[0] == '/') { rootdev = rootdevname(rootparam); /* find partition on same device as rootfs */ snprintf(ueventgstr, sizeof(ueventgstr), "%s/%s/*/uevent", block_dir_name, rootdev); } else { - /* no 'root=' kernel cmdline parameter, find on any block device */ + /* no useful 'root=' kernel cmdline parameter, find on any block device */ snprintf(ueventgstr, sizeof(ueventgstr), "%s/*/uevent", block_dir_name); }