From patchwork Sun Apr 19 14:31:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4547 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0FE6A3F1C5 for ; Sun, 19 Apr 2026 16:33:04 +0200 (CEST) Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-48919890a95sf1814725e9.2 for ; Sun, 19 Apr 2026 07:33:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1776609183; cv=pass; d=google.com; s=arc-20240605; b=O5OSoGMePncR3k1KVxQ6vND3wlFb1d5s2IiOaYzMlPze7vc9jsfgECt20YhpiVeTrs MuuADk3uqkufkt/L4rPKSikM1LzhZXAj2hWt8wuwdp5sWrOIdcTGOYpcF5bRIU1sLtvo wqN0jer5chUiU+RWtmkxv6o2Zl0ARz888JumlU7cjC1MODcAryVRa4EfuVvDsGfqAFyW sKRJPcCguDU9kinQl+o5J21Wd6uMpDyaq8eBzFfXbe+KUrcar4JfXJe3kS+Ry2nNobVQ xpJYvnkSDk903mPYQBsz/1WLkl1JVBw2Xmf3ziYOVW/mnuAT5LTV+qS9DTp7m3VrPkLv Q46g== 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=0lswNFhL5Ch2/NzX0+oc6kL4LZY9T2ZRa9x5yZJwVfo=; fh=oetup89fbwD8reMSgDFevO2qB1CuzNJBINVg23xulX4=; b=StLLOysbWUk+XSzbzukd9qYQg87Y4UDkOoUQqQWb8manJUDHRNl4qzldhGQlrsLSLd n4h6UMp88nuVsZs0cK/WOnxIMg0uA5r2UbbsJafw92ajnOzc3uWBMGQQDP7SpU84HNX4 oJJ9taMe/tBlK79VwStgbLVW0WNX07yGqgKEmIcQ6NLbmfHj8YNMitEd2/aGOkotNaen fP6V/Be3rvpBZUAzOzfU4k3bVfzmkqo8mo/Bicm7aerjSIKgB7Cusgsu8f0OPND3RSRf +F0rJfiQjPg1f2Yke2YHDdIUQEaz7ZZmGGRYIBIEtMiCY8M0n2TtnCdzy0aMSEmhwQZN kyWw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CmB3akZF; 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=1776609183; x=1777213983; 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=0lswNFhL5Ch2/NzX0+oc6kL4LZY9T2ZRa9x5yZJwVfo=; b=ER5HILeqAGYq0Er+W4lEtxnSwaxNJ6HW5Ncg3UybOxeUuAUwDincDjjMQsFV/+C/hO /gk7a5L3HaDJLoqjhqZ3x3cGc2of7L+4uWUIsqznb8lIVnzLM3c86aQ57wsRDm7ezn0P Yqbcp/xeD199YjJzKL/zwHjYqomf+K+KCNX5w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776609183; x=1777213983; 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=0lswNFhL5Ch2/NzX0+oc6kL4LZY9T2ZRa9x5yZJwVfo=; b=exUTKzZbkwTdltUp3cSfP+9Gk+OMU6IHEiM384sZAhXo2DxKKDxTQHQR6G6T+O4P/F pFHbV83M3nX1RGmOJO1C0AfoRVr1Wo5eTlA3lpwqX4w3qFNDPsE9uPZSRNy5yquAuejI EcYmIx2V5lHVrdoaEhBMxC5cz37JJX5IJFvS5E3NE2RbmvMnWJRNt7m1d6S8VFd2faG9 xF/sX2SntP7pBWSkoBCI5ZcoKpX6ux4U6pgM+IrmPqm+GOTWwDBiYCsu6SLVEyws6gyS aG6Wwh7PLFl1jPZ5JrxHmrH7SCpgT+3pfF88/MTV2mYawCOhM7JetR811Omyr9hvj5Ka hSyw== X-Forwarded-Encrypted: i=2; AFNElJ9E9ezHMdabyJoKck8jD2zL9WsBJPK17bLIYoQzylQtBzwQksYU6QKnmxGVQLSMhLsHpeh1becYbCbOP/Ji@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yyb0/oQ8P4JDttt46I0K2KmpBlLAoAD5kb3jH688N/enDjjycKl swk/xtTvqYoQtnIZRbmFfQGAoLqrdSbK8meJKTubOOmgg5Vgh/QVxgfhiFXi7NI6czMMTg== X-Received: by 2002:a05:600c:3515:b0:488:8b99:54a1 with SMTP id 5b1f17b1804b1-488fb78e7c5mr135138125e9.28.1776609183634; Sun, 19 Apr 2026 07:33:03 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiLFViWA7XYBMiGRKkT90AgQ+KCtfTXNhpORsFK22SwLDg==" Received: by 2002:a05:600c:a404:b0:485:2e9c:9e81 with SMTP id 5b1f17b1804b1-488f4b0f219ls23539435e9.1.-pod-prod-09-eu; Sun, 19 Apr 2026 07:33:02 -0700 (PDT) X-Received: by 2002:a05:600c:a416:b0:488:90ac:8f71 with SMTP id 5b1f17b1804b1-488fb73a9fcmr114149805e9.5.1776609182064; Sun, 19 Apr 2026 07:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776609182; cv=none; d=google.com; s=arc-20240605; b=hTp9nqhOMBKUwJf8SmEaTGCHv0NcQvDyXjB4nCrRUaz1pWGWYRxk7HJNg6jwF2QR+x lcSdLdOoyTVKfrk3s/bm6BX0Z/N3sB8M6RBbSCO5Nu2xSINc9Q8DUcKRCZgCQqMtfG60 GMgomQiYU/6D6NjKMUy1gvfWti5GShIyEu8czPMc2Y9/vEvAvzn8M7kKQ2+F+++XidER 6NVaFMDibGcRANG3epgWV1kt7PIOUyWHgFrU+ZKXeo/79a1zwQflWoizKHmoq1m9Tmm7 qBWwaG15qLuBL1fczc9SnSSD7sTT/Fzmqj/aAoGFCqhS6MO78hU/ZVxErMW/HjwKPsoD 2LLw== 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=oAoP9NlzWltH1g0ieIPWcLlhZGE6FDHWvuaN/OvBd5Y=; fh=m48xu6nnYHLvvvmMgghe5OgVv/RULa4LC59SBiDtwXg=; b=IUlDvL6xh2sl1g4pW/j4dB/9VJ0J7KfD2e+RUFmai0qbRk5SoEi8bzZaRR9J3e/vLt mk//xY/8DCSiF5h2mQfYfm7KWaYjqcD8MxgsiHQD5Lj3jqNVCt9QeGB+zs3+ai5Tdc9J wgY9yPTX5Hf0vxb6dMGJUaSPo3OY3n3ybjDIU20CaPxUfoKb16JJXv5KJtjLMsCB2D1i xz3QgHV7yG5uU2kxRLhrBf16//wkH0JNbKyBm6/Lf5CGUm1S7oUq2q6a7EWlU79zYkqY s1kY+h+XUnV+1aEHpnFUC59LH0iuAlXbTiGDp+thYZetIWI+eLoJ/xIlUTOgG4/SmGjX 2BMQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CmB3akZF; 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-488fc0fdeb4sor11346155e9.4.2026.04.19.07.33.02 for (Google Transport Security); Sun, 19 Apr 2026 07:33:02 -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: AeBDiesW6D6ihTm3uACM4r65/6ChdMxqmlYCABUuxoxmrBuGhq1ys60QIm7Vz7TshMo H+XiuQj389NYjjFIxNNLqCfB/ecj9C6UGDmj64mzz9gzf32PgUedXHkgeak6eTTROc9cfAcsoTf raTj5Z9/aalp0LB8qjSHd16EnYTB4uGuHtsN9QXRdlEo20Nf3hCAKTAXi1dRz+5aBSuTA2TAD7V ECo8ooOUhdB2q+J+Z70b1N7xGgASAAIL+JjaACC4mlnvkhopwOCWjPcnVat4jm05jHWuB89nDoj +kmA0ZU6Yj1gAUeMi+PbG3Sunm+yQaGlMVc1U4lFL+t5d4qHr/CSDLAoUI/gTVGwLlpqwFxvvWl /CVhrSlWLuprhlACUs/J0oVdudOPMv1d9Z0F3scTKWOYywIDsgIdH++dYhUgmWxAJlzxYWH5/LR B5HmkPDJvhPvcSqKG7lDCqbJzasGENBEOku4Engb4q5x7NKUtxmLmFHWlZ0uc4xFRpTuvPJQNrL fgIuTwKjKabD496TPpy208/dCXUUrQ1cgUY9ZAQ/Hl+Tz4dlP9TvqELZqcSWyH3ZAT9GRWA1l8e Kw2sZLwNTLm7TSIO8FQbI9RrBIn7HPeb X-Received: by 2002:a05:600c:314b:b0:488:c282:e78c with SMTP id 5b1f17b1804b1-488fb77870fmr136331995e9.19.1776609181607; Sun, 19 Apr 2026 07:33:01 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it (host-79-20-97-39.retail.telecomitalia.it. [79.20.97.39]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb755938sm86864245e9.3.2026.04.19.07.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 07:33:01 -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 v4 4/8] cmd: part: support lookup by UUID Date: Sun, 19 Apr 2026 16:31:44 +0200 Message-ID: <20260419143247.437733-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419143247.437733-1-dario.binacchi@amarulasolutions.com> References: <20260419143247.437733-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=CmB3akZF; 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 --- (no changes since v3) 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"