From patchwork Sat Jan 7 02:03:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 1722639 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=hCaj7jZO; 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=ZcBWbV+p; 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 4Npk8c2xspz23fK for ; Sat, 7 Jan 2023 13:06:22 +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=1MblEHjPISDrgsafxV7CqilanTzHz5uEEhcnmcAjfkM=; b=hCaj7jZOVAIqGH VlqEJOcGjNo+bskFTJtAHKEJ7N+tsSyKl+tCFucAA4KJ5rHZY5OqJAd+JhW19kk5axVEGF6P/lKFs ZnbmRIQ8xUiesVyrKwch2U/+ewjFrCDn9MWXGa9S5axmNE4djnA1khp3y6ffK5GIXdYQFR3nfzjMZ i/HxF0ymC1a0Yav3f71ZU3CSPgFJs1WH04p27whE22TrJ+bwmEiijI7WX6peX1MeQIMRYS/Ay8Vdw /gsAifr54X+2mLeodUQzeLzeZwRgo+ckRIVyZoUwpoe8xDkW/iNvFxwZY2PbbCN/Yg3fcxowfMYYY nmke7Tx0qHrHqnEbbTiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDyYO-00GUjP-PD; Sat, 07 Jan 2023 02:03:24 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDyYL-00GUfX-7S for openwrt-devel@lists.openwrt.org; Sat, 07 Jan 2023 02:03:22 +0000 Received: by mail-pg1-x52d.google.com with SMTP id b12so2328947pgj.6 for ; Fri, 06 Jan 2023 18:03:19 -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=pVXomN0+VSKNCIwStPi34Wv6FNsSiZvOZaoF5yOEuLw=; b=ZcBWbV+pYoZiQ0TyJKqQV85wdF3B+1zrgsX4gTyTOO0eRqK3PvF0GMPXCYeSGCinS5 hqti04irT5nKf2M8qNUxn9IS/FLy4al0ApYPPfzvk6ioDWDiNnVTPuS7M57uc3nsypas rIJ8Fp8QXKqceOmntUraaSxAc2wSv8t7RSEmntY9mz4anpwLZfGW5n+wR0Hv/FR/OpJg R1NODBL+QGDNutJllU53HaTD7qeBOJL2hfZQMaDriZMxXr9ZB3sn6XbLYSrM1t1M3NR5 zPfrUcXpsXTorcCG7r11T9PxJ+dJjTZ2xTTDTNFB4GjgYIBdrLXNFkPMuclaxD0bcL3F 1cng== 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=pVXomN0+VSKNCIwStPi34Wv6FNsSiZvOZaoF5yOEuLw=; b=yn3dm8NRF6HcpOtKz3exjLQHoau74f52ZSWe7wMBThm5FcDp4BPiwNTlB3975Fn6qf hwCtBHUCDOdXZUClWFklPoUI55V5EwJzT13RjhfmPTSVtvaXdL0HkbLdVJEoxoKKtfl9 jO9dWtCB/5NpUNzICYvCBNPy14vTh27N4vQ4n5F46plkH2Usf+g+gNXsvmEk2wZ45akd +M/1ETtBlesPme+I0SD/qF5v89euSBi7ExTVQ932JEvz9POO8vic7VojPfnpI0BnLSfW t6JfibtuQ/+Pi7AvBgenLnI/d5haMzhr8HFzdfxzYwLlQiOgM6wZAEAS2C5uHeWA3cNJ 8APA== X-Gm-Message-State: AFqh2krMX0dUbjYRHiXIeudUsv65OSaruVElDTwYHsWvNd1TLIg3iPjX 3uy28XlGuazeI6WPDPp5lyebt/rpdEk= X-Google-Smtp-Source: AMrXdXu3B2V0uERK4/v8TY4MZDgY8K8a+v0eRzRZ1BFuVhiy2IAhcYrGCtcBRmm05bxqXeiu9fo8DQ== X-Received: by 2002:a62:184c:0:b0:581:1e00:beeb with SMTP id 73-20020a62184c000000b005811e00beebmr47988372pfy.15.1673056999232; Fri, 06 Jan 2023 18:03:19 -0800 (PST) Received: from localhost ([2600:1700:38c1:1d7f:f66d:4ff:fe3c:3ceb]) by smtp.gmail.com with ESMTPSA id k197-20020a6284ce000000b00574b86040a4sm1737492pfd.3.2023.01.06.18.03.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2023 18:03:18 -0800 (PST) From: Brian Norris To: openwrt-devel@lists.openwrt.org Cc: Brian Norris Subject: [PATCH fsutils] partname: Ignore root=PARTUUID... Date: Fri, 6 Jan 2023 18:03:06 -0800 Message-Id: <20230107020306.1703532-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_180321_289849_029F84F3 X-CRM114-Status: GOOD ( 11.47 ) 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.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 -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:52d listed in] [list.dnswl.org] 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 --- 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); }