From patchwork Wed Apr 15 18:31:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4538 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4894A3F2F2 for ; Wed, 15 Apr 2026 20:33:12 +0200 (CEST) Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-43ea8161c3asf2135883f8f.1 for ; Wed, 15 Apr 2026 11:33:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1776277992; cv=pass; d=google.com; s=arc-20240605; b=gqtoHUAKBoXhEC1F1QpErrd+qGwy7gucV/MKi7/kI18A6Tv+f9wII6vGRSaPfpHNMI RMF9tBayitCSoY6Wd/7uv/P0wpO8R1AtJHb4Xf5c/eyxH/TElFUtQ7BpYskVbuhNzYiN +muRnyW1rLRRRpVuoYmP6KDhXRmettXTuAkTU32tn34841YRCeD6AanxYLskfU+8IuwJ 3JZDOOPiyG9QHhBf0BvGgsXEJ5yT1tNznCBKAYIsTWi2+uWIsbXSmNVM7MRYIkCaHxhS e02/fEmg2U2VJVHdq8uUQp0+wwx2+Lq436JxxIF38hTH8gwrD75kTJUVchQtQYnqA6yq 9xvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=+W6hfl2/wAHI0yd6HlXI6GBkchnVYpAYNi9Hk7HG/1M=; fh=271jXOoLd3lUBxZSgb9xqKO2pd1kyg7+nqjQ6wHHdTY=; b=aBTS6g71pCv3cjbpqs3H+GtV/DVIj0mnBLlMUuixh92WU18u62xkfljLebd2QDQQQ+ hziLIohLox3FZCfO64qLsSgOyjVfkwHfM5ST9e4lG/RzIEwTQTwkRx4aR48XLPLxJJUQ g2rMgl6eSV5Mt/QFVfP8+oBoQFhKs53hZ4M6qYiEH/q81Fio6p4Gei4SUwF6kT2eXObe GBwxpleAQhPTvmYy241zi4BV1OCyiLMsdNxHPmie1V59lCQ4HPPTWn8lnX+1C+wGxHbn e/YINYO83K6PN7QRjIrL+JNOkgteSqOBatb12IzXW51N9n1fwejYOgIBihHgP2WS0W3k im3w==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hV0xgZHX; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1776277992; x=1776882792; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=+W6hfl2/wAHI0yd6HlXI6GBkchnVYpAYNi9Hk7HG/1M=; b=a9P7Kw1kw+Js4w8ETdQbuje4NVrDQUR5to0vePiLe4UdOKP6p1mln3jMMTZKjcecas sYjaiCH1ZWyqUzvoLY23+lzfe5VEvCY2IkH/Dq1F5IrBofKFmnGVAyaM9a/Smux/gy6s vDmCldLyRsbHuum+grLkx0xge83PDAIonHT+I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776277992; x=1776882792; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+W6hfl2/wAHI0yd6HlXI6GBkchnVYpAYNi9Hk7HG/1M=; b=n9AQFSm4a010gNzAPPoi1olxXm9VMiU623ukgtOizZWkJOyhGHcY21QKDym9Ik6w24 AUteqiaJD6aHS5nOq/0kU+jj6Hu4frp3QZWRpmzHS4nK4rmUbIEc8GmbT+3GiXNiwtSW S4PTPw+AG3GHq1OAPeGHoSDY5C48Pu2MHC1nHgQXvQ5viqTDA6M+M9Qapbyt1CEb8a+9 xj1veqGzLLYfZYiYXwtgHfzh5nUVoYE7wRLeKH3ukai//PNVxi2yOm66GtVcpqBZBIAv Nmeo2HrKzeLY16XAI2Qhvk8pnN/MSXTLH/+8r0OaRfgSTlABIBYC2plvSk7kZzgBeTiW i5NA== X-Forwarded-Encrypted: i=2; AFNElJ9gUHKdTW6jDKNCQyB/UdCAn0BLjd6YP73+iE2H0xviDFM+rBWrsMosu8QUbYV1NJ51zJFEnS4YiYpajFQ+@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yw152E3s/SVDMX5/Xp3na8L/G+b8ky1Odq8IesW4oL+f5Koa9b1 ZQfeG7ZgUZ0eykFpeRidxeLXVf14oN3uasvEGZjv0HXi1oLb7y/+q6Io3et83kDt8QgxPduOUdJ a0g== X-Received: by 2002:a05:600c:3b24:b0:488:c078:bfda with SMTP id 5b1f17b1804b1-488d688d2a1mr316478125e9.26.1776277991848; Wed, 15 Apr 2026 11:33:11 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiIcvFmf2xEoAmVP2yo+V8YnaJFOTm5n3wAb7FCPDDjIDg==" Received: by 2002:a05:600c:34d3:b0:488:971e:25de with SMTP id 5b1f17b1804b1-488f4a74142ls596335e9.0.-pod-prod-03-eu; Wed, 15 Apr 2026 11:33:10 -0700 (PDT) X-Received: by 2002:a05:600c:3b24:b0:480:2521:4d92 with SMTP id 5b1f17b1804b1-488d687adb3mr329485085e9.24.1776277990062; Wed, 15 Apr 2026 11:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776277990; cv=none; d=google.com; s=arc-20240605; b=BswD91Ni5bsxhBOtL52rjAMDrvWP8nvbzVWStBdlmNA0g0UmTx1wazdUnVDzTTTvfF NirktpkkiEyWT5x6OpwpBbL/fPGlduL/nITwOY082c1kF57b4pgZVSJagyRBjTFE5/E4 qv73BUG8cd/J/w0ogam+hqzlhIdEm09IyZPvesBgZ/PWVOyX/I7AnnZsZeaedDWut5GE 8y6pOjMOejeJKemqkW9VrGCWmTpr3ML41Xu1rvAtVOQ3JTkcl+5VY9xZ+gMbQbcP7YFq tVZOnv0A5pX7iNunsMlPwxWyGhqG3OtRcelJQooioPX8ZQexWgedjWCG1C+h4q2o6TMv N95g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=z3+8nQO1lWNU/GNjJEORKTlW5YmWXTKb1BAPU2O6ctU=; fh=m48xu6nnYHLvvvmMgghe5OgVv/RULa4LC59SBiDtwXg=; b=UAQcmOiRJjsZ6d66qpI4tbwHEiVFvGEFa9DjPA4lMs/Voy+rrAkmQSDmRRKVEKdXte EdZblnuQSK9uUWDGzcmXyPdhcBPcDh1hVjPj4dwTeu58hb9oKSegLSKOQclyNW2LXJfK Yk5KUMsBXHDiQXw4uR0m7bGZjcwPMkNs3SgDJnfuLETNa91cxhre0IXc5wcnQYoeTLpU rInxllr1nmcwJWwtDkGA6wSXPFW937NUAbUVL5ZX7ssFe0N8m9GDWLYnWqj465+IIoOl KCux/OYwhZoy6xxxG+e5vS/hPEcQw8CnWF9WSLx/t+bsMS1ER010KJDL226krjDofKJB U7Lw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hV0xgZHX; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-488f1e870e8sor4409885e9.15.2026.04.15.11.33.10 for (Google Transport Security); Wed, 15 Apr 2026 11:33:10 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Gm-Gg: AeBDiet5hpV8xifkBrO86QLNiuCBPQz83ocRcfFEUeMqGjOxPAec1IMHbsLjBhkx/ug r1+WT/LhwB7MNEujjrGo9d26RTkScCAMSmgvBJZQSO3B6b/LrpxEtHmUa71V7NSKAsrfXlx0gsn 0hilpOd80Z4OnFpMcNZZxCh3cZBOa3a+S1sRn9zVb108baaHNKpg4KqNE3Afeu9KQ86IKmG9y9h LpxJB/l7V1Q6FpYm5E/8sblZIkJ3q3oYBMtSHit2RTxM7X/Y41c1V3Wq2jzCrNX8eszI0iSUN0Q OxXaEV62gOLbgbmYrgQNyRfsKJoEnEnG+FrrCwEomONWYe/Kk8nGvOcfj2yiEv6XeYyOjzldii1 sScH9fN+I6zD7ZqXG7+s07u7SwxzCmVv27YeAdie2xXjAryi7KX2hylo3XdVC6hJb+wkC24H/Bo m1pTFwbicKdmNfW5yjkZIiYYf+cmGjiVLPNHUbkmS+a7QUAFmlDZ9c+YKup39MNCyCHxRjrMwi7 b2/QGiEBb3XSyfpppaiFN0RC2v7+rZ26Fo4LZlLQa1sZxRYHs0L+cYtwg== X-Received: by 2002:a05:600c:46cb:b0:488:c51f:e04e with SMTP id 5b1f17b1804b1-488d67f3a0fmr314282065e9.13.1776277989582; Wed, 15 Apr 2026 11:33:09 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.amarulasolutions.com ([2.196.40.93]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488f0e72980sm34953115e9.5.2026.04.15.11.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2026 11:33:08 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Simon Glass , John Toomey , Padmarao Begari , Quentin Schulz , Rasmus Villemoes , Tom Rini Subject: [PATCH v3 4/7] cmd: part: support lookup by UUID Date: Wed, 15 Apr 2026 20:31:31 +0200 Message-ID: <20260415183250.3031030-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260415183250.3031030-1-dario.binacchi@amarulasolutions.com> References: <20260415183250.3031030-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hV0xgZHX; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The 'part' command currently allows looking up a partition only by its number or name. Extend the 'number', 'start', and 'size' subcommands to support looking up the partition via its UUID. Unlike names, UUIDs guarantee unique partition identification, avoiding ambiguity. The logic is updated to check if the provided string is a valid UUID before falling back to a name-based search. The help strings for these subcommands are updated accordingly. Signed-off-by: Dario Binacchi Reviewed-by: Simon Glass --- Changes in v3: - Add Reviewed-by tag of Simon Glass Changes in v2: - Update commit message. - Update help for 'part start', 'part size' to mention UUID. cmd/part.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/part.c b/cmd/part.c index 5e520d707f39..3191d5861fdb 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -144,6 +144,10 @@ static int do_part_info(int argc, char *const argv[], enum cmd_part_info param) err = part_get_info(desc, part, &info); if (err) return 1; + } else if (uuid_str_valid(argv[2])) { + part = part_get_info_by_uuid(desc, argv[2], &info); + if (part < 0) + return 1; } else { part = part_get_info_by_name(desc, argv[2], &info); if (part < 0) @@ -517,13 +521,13 @@ U_BOOT_CMD( " flags can be -bootable (list only bootable partitions)\n" "part start \n" " - set environment variable to the start of the partition (in blocks)\n" - " part can be either partition number or partition name\n" + " part can be either partition number, UUID or name\n" "part size \n" " - set environment variable to the size of the partition (in blocks)\n" - " part can be either partition number or partition name\n" + " part can be either partition number, UUID or name\n" "part number \n" - " - set environment variable to the partition number using the partition name\n" - " part must be specified as partition name\n" + " - set environment variable to the partition number using the partition UUID or name\n" + " part must be specified as partition UUID or name\n" "part name \n" " - set environment variable to the partition name using the partition number\n" " part must be specified as partition number\n"