From patchwork Sun Apr 26 15:35:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4558 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D6C7C3F206 for ; Sun, 26 Apr 2026 17:36:29 +0200 (CEST) Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-48a5fb71a84sf20646065e9.1 for ; Sun, 26 Apr 2026 08:36:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1777217789; cv=pass; d=google.com; s=arc-20240605; b=YhcQfFLrIz5jBBn+sSAgfLC1oj/odY2bc3RMWdtenLWvtqu3VDBqVEBClco59r0f3i hn9tynQyUKS/jH0+NS/mt1M72bQGQT/Aw0VOYic1BJcztu4XoD7IrTdltWqImS2hnFsU qkbZaz7OEx+L58fbIuNWo6kfyvQM8QpJ7UX9qyspMiA2JLXf6H78p26hN196BHtqskuF 7l1vs4wSIEGIzKqUtzd2Db/j1kFXeNiTG40gGFr9rtu/6iDxKF6hM4xjDnHV0yRnZNNG BedNuwIvmqdl7+yvnM/TTBAHQ/unfOy4dGd8fLgvzAdgMNN/sMluUQAOlTY8EYzSP32H OTlQ== 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=K855vdwvBLJUQJTqsDo0oAPRqQMZ9CVWL+0bVAKpXuk=; fh=UjpOiVI6RI/5bKDHNWPszDfg1mFu2nYAff2jG3nhsuA=; b=OCKXWjWbDt2pVvdthjeiT8NysIALDWm3R58XMHdEWNls3GwnQMVqxl4M5qGPQKLWAN r19fbkjYT4CikswzHwG0PGxR6sx+hJtv+v43JUPfgeBjNy1SfpCvhwGFpBOFArtj30V/ LdEOwktPW6lPm5aaZElpck+EjPWf3Sp0DoJdolxY2Ax1YU5zN/IrN+ajObtUt5yOzKhA jkL7w8A5xeHElelEG3pSRa78Q/L4d41GelnPhSRAuLvo/3Sy53/bEqVu81/dNDQUkt/7 FI/Eth6ff6Yw3klfbBK/cnGXGv2mIBzNKFHvi+dTOouws3degDhMBhAqY4Ap6qnp4mhL AHoA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Aa0qP+h4; 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=1777217789; x=1777822589; 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=K855vdwvBLJUQJTqsDo0oAPRqQMZ9CVWL+0bVAKpXuk=; b=oLW379qk9n21fnoMEBv/q7a9NzkCZRDyZG/WTtnSB5bItDr8IB9KbwdQiv2/TwYmfU XWAmWLiKUVhkpfSpndgvP5xJWf/2hGI2+y1O+PhHmXD39YfSqSpww6Aer8MF70vXE4BZ +sVQLQrVol4lMGMNewK4D2Q7aXgh87/xlfo1M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777217789; x=1777822589; 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=K855vdwvBLJUQJTqsDo0oAPRqQMZ9CVWL+0bVAKpXuk=; b=CC93PrSKzrM9P96TtgDSJkARpo5+e1nWpKsBqkh9jEUa1uIE41ESdWQ77oEY3iMAhR tU9WH5BAMKSkMGXDsy0ORYd7yqIbydiwAyo9+wQvJebpp+fiXJ4DteVoqN/XALSh4ZSw 4ke6lK6DsxQmjM7LVEUT2kFdupoIz84aBXWhSxmqL4I/FBk7TM28he9wOT6aJUIU6ctW A+lexCBMXSNPo1BgLHkND4St+b9Z20DtP68AZs+eOhvZqfxJCj/Fk/sdMUMINLS6J8bO 0mnCgwTOCfDPGyXSklZsqhYUVaDeeK6YXYyCWQYROdqvEq0IF82fvac/SuqP9neIBIJb ZRNA== X-Forwarded-Encrypted: i=2; AFNElJ+dAVYLG8RZ75634XdRHh2iItzifT4JwVM5UDdWmh3/exGqEs32LU2JOr7IM9tuki33lWUTvk8fTI0ps9lh@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YziJgyX24yCRNwRryr9QQOWHoQS2+Y3sCxJ7iQxDQfpm6/+MRD6 JHQB+Gwfzytr63lJFSOl48ugNBD2tslV2xkaybpkbcjddMqPUQ0Yncf7avmz7m2BMYyRdmKleQJ HLw== X-Received: by 2002:a05:600c:3150:b0:485:3cef:d6ea with SMTP id 5b1f17b1804b1-488fb8b9debmr105203485e9.13.1777217789445; Sun, 26 Apr 2026 08:36:29 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiJHrq+eJu9J0tKl7LNQr210sV0YrVYc0ndBM2N/s3rAjA==" Received: by 2002:a05:600c:3f0d:b0:48a:5e52:aba4 with SMTP id 5b1f17b1804b1-48a5e52ae12ls17353675e9.2.-pod-prod-00-eu; Sun, 26 Apr 2026 08:36:28 -0700 (PDT) X-Received: by 2002:a05:600c:b96:b0:48a:5339:a46 with SMTP id 5b1f17b1804b1-48a53390f6cmr347938415e9.9.1777217787734; Sun, 26 Apr 2026 08:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777217787; cv=none; d=google.com; s=arc-20240605; b=kNAwzdizuTg4K1o+H7VOsxwPTGtMaiBN/CoohIo/R01Mqopm4vMuGTM8ClwkBs76xz cl7APvp8NPvfI0tfCTRskoC3ldbxcGFh1y5st46nQs2heuSDuWNk+ydEWiJ6s05H02vA /CLN4EYTXOiPcgnNnoykSwZoi9LaXgASLH1y5zjLzv+YTQQIo9bOHbs7qe09AR/l4F3R 4kXVicZHQ06QJKMr7WElW3gNjNlPwSmtG/4Hs+DwPlyAl/Umq4S6dH+y6s+E/vTLDXuf hnKjKA6l6QCAaUpFLQJwsIjI7lhOGH9r/dg0iZSVpD9jjVaDQp2OcLVzQUUiF/b9syeV peHA== 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=P1GVI373cyvvUNNV0++FED9gkmrJNOa3SBgfOLc2fAY=; fh=/Q9I6E+fkF6NOPQEns556/DWN091er+VFMWUljXVtro=; b=IqFMbk8xgc2Pgjh6ytsJryY415dYK4SBsFpDfBWHMcgI8gbqEAe10+zehtNIdZcyOi MltNSWPnQmo/pyq75uQlyhqRXAY5S9ba2aoXYgoMamJHAnEvVG1tx+9URPklulzcws1v FWcAA8py/yUc/efuc+5BdzpCJOsgqoVzJTzUfaItGf0xX0muBcIM6sgiM3xmcPpeVnpl KTkuHhVU+ZUjVYOaaUycmM977jVFv6w+Bwkte8MfzGuOqwfBFN5hC1usPMVHHmDmX2HR OD16gtWGdX35omUHOBLipaJx+dU/93kY/JqRwY3Dkn3Tx7rCcBfBcOnj+V8Wv/s4nkO2 8JMw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Aa0qP+h4; 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-488fc1aca6dsor49939515e9.4.2026.04.26.08.36.27 for (Google Transport Security); Sun, 26 Apr 2026 08:36:27 -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: AeBDiesuELMSg7E8F82LZjCizWTqFMbTkEmuoFH+0IUe0mtGMSQn1tyCVT7erUSVSyX BgrB8Vz+8qUmwcH8xCHx4h5rb5qf+9Q2D1dwC55uB4WH77/8StzJplzhozKFWJgExNL2xK2vBIy Vlfbof2y7Q8E53EQzDvqYC+cQmFTLjV1HNaOGSRVW7aZvEWqM96D7bFdu77Bv7dSggy8UP0zmqP 4xENWVGduuXb3y8/wl61GjctJ0l5lBV7m7CnMRP5nqMRWbFBHB2qzIG+J1REZYLTMGeCszQfT0R 5Y7EAmWO5lETMOqmGCtjWAlYTDMioiFXheGO3tjBhWILh/K2+UZcYC2coI7QjeUsYalP7NXnXIW mbRv0nXux+Eu/ASfDJQlIhD/FtCSTpBQ9rviqftcJjAiqHs3ndmhNY5Yo2m7DyjkRGkeo4NmBAQ rSxowDdenA0Hs8UVZcS9uziyxeDhz0EmYmgAs8Iiz/cogdJyAmjjv5MVXGQ46MxOTqPIZ/tSc5r mwbAz3qyPCB8EILqsL6r95T1intmbCtm7ZAIlHxjWYeEngxKcCsWfoz35WMAO0RXOd385VMwnF9 1hXEKqu28V1V1wj8hXLsbfDH2mythQ== X-Received: by 2002:a05:600c:a305:b0:48a:53cb:8604 with SMTP id 5b1f17b1804b1-48a53cb8949mr270477285e9.14.1777217787265; Sun, 26 Apr 2026 08:36:27 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.amarulasolutions.com (host-82-56-22-134.retail.telecomitalia.it. [82.56.22.134]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a5499b0edsm388438845e9.14.2026.04.26.08.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 08:36:26 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Simon Glass , John Toomey , Jonathan GUILLOT , Padmarao Begari , Quentin Schulz , Rasmus Villemoes , Tom Rini Subject: [PATCH v5 4/8] cmd: part: support lookup by UUID Date: Sun, 26 Apr 2026 17:35:29 +0200 Message-ID: <20260426153617.2039651-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260426153617.2039651-1-dario.binacchi@amarulasolutions.com> References: <20260426153617.2039651-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=Aa0qP+h4; 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 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, ....)