From patchwork Thu Apr 30 08:06:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4594 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 94A843F0D7 for ; Thu, 30 Apr 2026 10:06:46 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-6749e8562a7sf473930a12.3 for ; Thu, 30 Apr 2026 01:06:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1777536406; cv=pass; d=google.com; s=arc-20240605; b=e9Fo0CkAhXU3l6TIufQlyNoXGj26B9eqsKssIH711GmuXwo930GRaHoU7gdPeaQxX/ hvYAoT0W7Ftf48j4iiBAcPl/sEFnb48NXCXzbjw5Jk98cH0qkvlpkHAg2EG/mwNz1wv9 8npir+GxhAKS5JAl0doNBx6J+9MyXWTRWdorx/ek7BlsxmIJrqMqdHSpIGYe7EKgc344 Wovz6vspeCCs+kjmzwF7Rw2dHMRsbX1F7TXr+3Gt8pU0WU6EV4ATi+nup9cDG6bewMq6 1mmyFCcTrPhoDcSNZueamTxZipsUOAdHJGWm6x0RVEopvDl76WdPFFoTuLOuvTbcZBH6 ZqqQ== 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=RR2/x+4kp2QQjxGgJc6pNBBILvKbszz/eSz2cBDXsAE=; fh=q+Pm8GGqC7y9HOC07k+IB8yPBLWSfb4vPC/7zQW2Ngg=; b=XH9nAj8mW1S7OiuU94Jw50MbgI1SuYgXCszgjWUiNhNKrkjt+jxa0t7El+8jNTLrI0 PZlggIjyXjR+ecM+BoJQGte/Q6QUkThfchhPWUh0AA2oh7ZhDXnq80HbEDs0abA1Jidc Gyvp2xnWQ6UhhM2N52CY93ZTgzgvRfsI5aYS7uAg6DielqnH/+pfzJpGOQuTc1LJRZDk Qz94ylJXfw86pf9Xtd8g5Shqbi6CCY+1wpO5mNiUI/GRGCF/aCjuOtNZ5UE0gLQAZ+TZ LWC4DdSMaiFYBJrCheBj4TobumVKAtCU1LklTMN6mHYdSmIw+WUmcpsznfNL47gSgDqQ YlNw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gz8ijcxX; 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=1777536406; x=1778141206; 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=RR2/x+4kp2QQjxGgJc6pNBBILvKbszz/eSz2cBDXsAE=; b=Gpe0GkEb2hAsT2W6FmzJkxukFmwriWlFRTImuioquchu1UD4/YsBkifsabAHDWohOV pVnCAx4x1VjSDJl6Vmkd/3WemRxZKEAWRfCkbu84mIeW/vy+QpdS0B6FBzsWF663npQA V6u3bffkoFdow8evC+24ahgHSUOwSZs/fxRE0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777536406; x=1778141206; 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=RR2/x+4kp2QQjxGgJc6pNBBILvKbszz/eSz2cBDXsAE=; b=rbbAmrO4/u/3Qp9mRXFIbq+aOAVFiC93z8kxFtuKAOBTd+swY9jThaynAkZ+eMtSAn fLq5vILXPSwyq88BUh+ZHNVXUksz3c+EGSjbA5nKVGDxeztvpWho1Nq+lUSijZTZzRb6 JP39M9cTc9SyzH3G49aket9TI9TbZLnv7GbQL3EvOPqBLK2kU1oJinZf1ksHBnBI5VNR 4jxMR1BLDTLIzKAvLNpnlZX62Brjk2uLSzbuk25M481h5yWOmWXl1Be5uDrSgFsFQ4eR 8Cc+OZ0Am0NGuI4q3u4ft1MLe5dP/Mjh3e3umMIHnd2QIGGzbMXzgK1RPKiPfr22hqDZ bsZQ== X-Forwarded-Encrypted: i=2; AFNElJ+8/1iOYGUJb2Q/ULA0+23L9ogCI9uperCu+Sl6IAT6jH5WuFN8fHvi4HJZOFOKmUGiQYrcRs53LEhXIVqs@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxjrYb/5k9QktwWfJvItwcBSlMLsUHQb/gaVfM65Iv7DJQKViNU 7ZQh1bx3PCrFxXQ45HyTj5U6COsv6Cb0j/yzGPDaaL2uVtTBo/PQnpsSfm7gAAC3XDTcRg== X-Received: by 2002:a05:6402:4314:b0:670:24ea:893f with SMTP id 4fb4d7f45d1cf-67b5d81f7ebmr785413a12.16.1777536405980; Thu, 30 Apr 2026 01:06:45 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AUV6zMMJ7qSPs7JHnyPFZgafRWkFsjRtjF8POi373WXaZn2IBw==" Received: by 2002:a05:6402:a292:20b0:670:70d8:3fc4 with SMTP id 4fb4d7f45d1cf-67b4ee59608ls449284a12.2.-pod-prod-04-eu; Thu, 30 Apr 2026 01:06:44 -0700 (PDT) X-Received: by 2002:a17:907:e113:b0:b98:2462:959d with SMTP id a640c23a62f3a-bbac6fae318mr79016066b.31.1777536404104; Thu, 30 Apr 2026 01:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777536404; cv=none; d=google.com; s=arc-20240605; b=HEMxUsvhNSwk2UHJTBUQFYrHaqL94hVLbhxNmY4oj/BZK1gwC9QX6druqdG6Ve01uP A8D7e6xvYqElKdpU8VFQIfvG5Uq012PeDTNVtVOZXnw9RDlFrwe+GNf181qtBOosoJQ+ t33njVVzes0GmSV7//nD7jMrZg7JhZelGu+8aTqv9x1afWCSe3QqBHJtgbZpWnGIDyoz 053gdJJkMwkFEccvzDHgXCCC9OinHFpP0/ZoQZ4SR4VBPOI+uybx1HBBxmvPxBaSPVk2 DJvfMA0s7SdoCd+CJ8aEoHkuGiKjkvzpZSO0IEKBBBeNZlOTjkmhaF9YM2/fn/fopDxS mNhA== 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=xRUth/tej3+7h0oPp5SVnZPyDPN+il6XelJ/U9ZGoW4=; fh=LDHFXjDXvbFl26G5DS7LYzEDDTHYFOyKjHb4XG9CD+o=; b=O8J86t5h+/RX6egE65U17Fuh4LdQJLd8mmXjG7XfzBws4j2ectccmTdsbHU+abCgBb C6oKL/rhx85iDQ48C7OqZ1O14J4pSFpeBToFZP02aEDFW6qT5HtyyUH6/8QWlmSsLuMv XX/NfR2ECc3x/W9r+tTfna0VVpXWuLEpEM846/wj4f39+6Q9Vo4CbaJ8bHy7EQ7zSL9x lr/tyQYAUP+UR0bdVxBc1Pw0VlFHj8SfhSurdfZakbqcEKvS57BjRX6UJXYUuODD4t92 COdXUbkm8TCiRSBUK1FnKbwcdMNpV6ctp4VQsnIQGMj0mjDcpXEuulqKQU1w5SePPRPe Fp5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gz8ijcxX; 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 ffacd0b85a97d-447b3d4979dsor563482f8f.3.2026.04.30.01.06.44 for (Google Transport Security); Thu, 30 Apr 2026 01:06:44 -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: AeBDiesgA/3wo/lTRXXs/jdM/BJZGTMq8DmqE6F8I8qLhBRxMaw5CiD01SNlVLJMbT/ 5BWw1EQLd8ILLT/C4pGSGc3vn7Nyzuce4GwVzpdWsohvceAVfPwbpzkN177peItJSUgwhO84Dl5 kHZNNkphx1n7D8VCPyHgKwqRbgERo9l0Pi4pnxNgfB5X+eXFDtkiOousmnillHZOWtkXxErWKkB xSzy2Dbwlzig7rcPhiCd+lEbMRCiKXbReV0NFy9Sdk5GyqsH/MT+D9aLcFkA6fv3y/09ihV89gT VVB9vsv5iEtbACb+uQWlwFarsLWThXOwEF7LqgVmLG8BtFmqlCoPxTnmZk8qugzY6+rcd/yxelY 9WGqmOjton99JvXP42GroqXYsECvic8kOxmPDkyemdZDmTus9kTZEQ+JJYLLsjh8Qg4ajJhBgsx QJ+SJ6neJoTMpcw/AwhYqxLqtUFXgOFqwh/oLPAy9MHhdbzmbji5IlIeD8DuzraoSvnXWvN3hH5 uRYfILlKmRgMj5CVsE+TTSC6mGLW6ReXGFtrsD95I8aYvrGnbUwZSkt8JQsM7YcnEO1Y7aQ31z5 /YTsiDfh2OPlt3MfzfqFxdE5vr/Nw9IJKzk= X-Received: by 2002:adf:ec48:0:b0:449:9aee:4573 with SMTP id ffacd0b85a97d-4499aee466fmr794176f8f.18.1777536403431; Thu, 30 Apr 2026 01:06:43 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it (host-82-56-22-134.retail.telecomitalia.it. [82.56.22.134]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-449c576d0a2sm668071f8f.31.2026.04.30.01.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2026 01:06:42 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Simon Glass , Heinrich Schuchardt , John Toomey , Jonathan GUILLOT , Padmarao Begari , Quentin Schulz , Rasmus Villemoes , Tom Rini Subject: [PATCH v8 4/8] cmd: part: support lookup by UUID Date: Thu, 30 Apr 2026 10:06:05 +0200 Message-ID: <20260430080627.849636-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260430080627.849636-1-dario.binacchi@amarulasolutions.com> References: <20260430080627.849636-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=gz8ijcxX; 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 v5) Changes in v5: - Update doc/usage/cmd/part.rst to reflect the changes related to the part command. 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 ++++++++---- doc/usage/cmd/part.rst | 6 +++--- 2 files changed, 11 insertions(+), 7 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" diff --git a/doc/usage/cmd/part.rst b/doc/usage/cmd/part.rst index b91f6541f7f8..a0e7be08a9ab 100644 --- a/doc/usage/cmd/part.rst +++ b/doc/usage/cmd/part.rst @@ -52,7 +52,7 @@ The 'part list' command prints or sets an environment variable to the list of pa an optional environment variable to store the list of partitions value into. The 'part start' command sets an environment variable to the start of the partition (in blocks), -part can be either partition number or partition name. +part can be either partition number, partition UUID or partition name. interface interface for accessing the block device (mmc, sata, scsi, usb, ....) @@ -64,7 +64,7 @@ part can be either partition number or partition name. a variable to store the current start of the partition value into. The 'part size' command sets an environment variable to the size of the partition (in blocks), -part can be either partition number or partition name. +part can be either partition number, partition UUID or partition name. interface interface for accessing the block device (mmc, sata, scsi, usb, ....) @@ -76,7 +76,7 @@ part can be either partition number or partition name. a variable to store the current size of the partition value into. The 'part number' command sets an environment variable to the partition number using the partition name, -part must be specified as partition name. +part must be specified as partition UUID or partition name. interface interface for accessing the block device (mmc, sata, scsi, usb, ....)