From patchwork Sat Apr 4 15:23: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: 4515 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 30DA23FAEE for ; Sat, 4 Apr 2026 17:27:02 +0200 (CEST) Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-48884e969f8sf15287245e9.1 for ; Sat, 04 Apr 2026 08:27:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1775316422; cv=pass; d=google.com; s=arc-20240605; b=GdnZk0tO02Uk9wVf5t69Cz5QAvCLusWkxLgcOf9JRJrrKNahCn/tFTzoUiVkqsRQF9 ENDyNpgwrnvjJsQj7MiabSv79MN5uDEofDW5bZM9IYYyxYq2rDwgdiFqhf+LeuAgsTtD +suV5k25rC83yOZJWxsAgmVtGXhZsFEKhGV78OhWapLHrhBxJoX7SAQW5l620XKQJ7/D bQXrbtnFbQfpevMKGA+PpNP03o3CXAr8kTywfC0w4n2+Y4W4n1f66N81rtDG6nWrk9gw IKPAfJ91oQlCN1m/O/jzhTkwz6l5jlcQWhDYew08QjuHSgOSmuzpp0jG88mWCvM3BRp0 u8/Q== 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=MGFsTr47aN91Qnl1njv1PXqSWfMyZdl9RMECf4taeJw=; fh=ZgPS5QMTMCxGZA6lRq3pk/YPJOWwQ0HfzzGUDWG5rSI=; b=CScGmessWqAwb2i9T/w1C7MdRLfz4phGdw7gwuVFcFAfbX+qqp99LaZGlM3ixBDGzr gmwSWwpZwpcnl1CRogkwJy2b9pzqzVAuGFb+o7hl+vR4WnlNTe2xWaI9qCPL5oEmStiN iCR5d8RJ1A7/FPYiDfZlElo1PZhOnNhKiwT75+lZG+FpeRW3V2lYt3QjSDvR3YDXEDPC 0pqfFzaD8b1HoveFslqjvNkIMyp+Wsg8KBmx3vJccH+ot/1+dz0ZMffx+/NE7SSmaAU7 ZaAa1mFjSkgbWa1i87sLix4O3FYdcTWNIJZjoDA6n14Dl2eeVyMxm4vV0Hhq6pLTQLaP LkLA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="KOKe1Q4/"; 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=1775316422; x=1775921222; 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=MGFsTr47aN91Qnl1njv1PXqSWfMyZdl9RMECf4taeJw=; b=A3w3L4ZSSop0QaJeYx6nrN/AZq/fGpgBdcdMm0N7jDnThJQ/FjyUMiuY0a0dajrLcq NtMhWNGSqnP00rxt/IL3vOUHcdkoNg17qSxeQ7Ncsdn473ickYQbItMaP8/mRnkCLeQN WEbO0eKOMRkIjCOnCbs/5iZAqJ+MD/4riooGY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775316422; x=1775921222; 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=MGFsTr47aN91Qnl1njv1PXqSWfMyZdl9RMECf4taeJw=; b=VWx3f5cSh2StvMW935ETXzNRtNr0khPqADbgKNAL07s6uZxfiPe2D1iYYZlAmP7/tW 4j8sW+k2j20Hlx/cLzrIYJjOrlbS8FPzyB2R9Mm0Ykzbs5GjysclOHkRSVGQHd38XdWw mwkqgYgm/tTPyTeL6dushzJGiEpDke5leOpCAr+KRHAqoq+zKiAPigTwf0+R2E5d+pP8 YieKTLTeQnMVzjlaLLiyofNkn3REX/lIZATJS18s2ZRGClZaUpzVJHNyyIGmEXsCM8Sn w2oK8PFUBrq3cMLBBhHwPZqR8RCXlHu7A7bTVmIauHG14qEkT94aYgWHhHYXmpNwMVZK KRRw== X-Forwarded-Encrypted: i=2; AJvYcCX2ILk33fH6qhyGgpO/zovZ1d00DmrF1Yh/oIYwkXGfOmQdFQj+DbvmA4u6aoApcONRhNkQMGZKkSlXJizO@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YzA+vATsZqsgQDWSv6Eiv22E0gn5dlNh1nQ8ti5oZuWmAHXR3GL mmUHyudAtNy/ZNMwXh/blHLBRAVVQCqNFAvxgCJM+jw0MZmlBN3DSxqRIkxjqaDinP+Yaw== X-Received: by 2002:a05:600c:3b1e:b0:485:3f1c:d8a1 with SMTP id 5b1f17b1804b1-488996e728cmr98541785e9.9.1775316421755; Sat, 04 Apr 2026 08:27:01 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiJdFm0O4Fjp3XWnhBYWYUqnqseH4Hq4RGjzYnuy2u8D4g==" Received: by 2002:a7b:c8c1:0:b0:486:fa9e:9310 with SMTP id 5b1f17b1804b1-4888bcd7606ls18879605e9.2.-pod-prod-04-eu; Sat, 04 Apr 2026 08:27:00 -0700 (PDT) X-Received: by 2002:a05:600c:8b2b:b0:485:3a86:6392 with SMTP id 5b1f17b1804b1-4889979a89amr99042215e9.20.1775316420056; Sat, 04 Apr 2026 08:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775316420; cv=none; d=google.com; s=arc-20240605; b=X31p7wFiyeJUrPML7qDfY7eIRwLsCuRQLHqQpLX1xZ07DpS1XGoQQjtpc+fVnZcyOq smpls5wezVrx3YkMnadkRIhkUKhg9NxqjIRCajJaIPsYW9N/JRGZaOJhwPR2iymwfTqd x6QqBEB1cR3/9xWaqSPenSRkr9PinxL7rejTFxOTQ9MGvwzMG3CuNusULKxn1orHcLUq 50vRT0uBH0IM0+ygtDNR8lj5Fx1LfubyDxiTNwQpYxzLlavAnEBNI8hIHfGgu+mDIAd+ 6au+a2f/LXUWa5enrrMbyj4vg5p5ugklxM6WIXNXz5dfH3pQfGo/mNjrBz+N7y1aR2i3 W6yg== 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=bH/vQA47RNzuJc4JhmoSlpcUcqjPq5pSBmxx+vWuA/s=; fh=7yTW57Uybo+1vU99Nd/eHhQQNnRmuZyDKIGdecKoeU8=; b=RXj7RBBOD926cN7XqG9f/4ee5WEXVuqiL3Xq4/d55QiVNEA5wLH5W/uTijexw6rSWP 44fMAqDbHZ16UEa6qth5MJLy8QduQ399O8YoqPoqSkmzq4SmV71xu8DnlAmuL9GOc8mG cFXxCywVRDE1p+AzevfleUJJV0V+6BznKx0laPlJU6RcZVLoSV82X0DfITRw7zxs5trN s/umDvvysYOn/GWqM6MOVIwPQJVQ2fbxIFWBAM/RmwTA6PulxGM9docT+SamfmEBlQFJ YhwgnPvTa+QrsDoUMQmViuRYOCzqg9aocGiGuLdTBOfBU4cFOccd5LD2Y9ukzsDzNsBj UJEA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="KOKe1Q4/"; 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-43d1e3aa154sor1187601f8f.13.2026.04.04.08.27.00 for (Google Transport Security); Sat, 04 Apr 2026 08:27:00 -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: AeBDieshWdLmgKVFiMZwtvYhxKbwe11sXi2eOlCnzAGe2YmOdlxYphlC7ORZLESmzCS xfJOdVqbh9qDjW/AuFa+qms301jCGJd66oHcMsb3yRATRRmllsbZY3XLl28ccDpCKpejbIEdt+8 Wus8j21cE4kYP944l+zeV0HSvoQs/MRHGdHWBpGiTFUCTD28cRqYcvFCyr4081hbupVlrZHRr9D x6wz4wBAPRbo0Nwr8vFTzOHBKdZbZi67ZC2uwL0Kwgw0tRyqGLYvy/b9J3e9965VDgjRuC7tjxz DkkFn9DXuhvnEEGhf8AZMPq6KF2ASDmVbLl5lRXwZRVA/nW+4A6Dfrgf8sgY/c+0vHtsHTgG1Le Hzy81qhujTV4smieK1olUqqDxRaEbBEGby+hLh2QehSvC3ecUDBpyTY7FEOAE9GsM4EP/gYbcfD Ni6c87TwjuqoN6f3B7AKtCuZfL6IgcCgXI97AmMFDRDxAClfeApoJ9oOX9lGNpgPGUF5FJAaRpX omRxgTD64qXeKpG+nUiKJtd5NXKBQVjywNAYacl8bBoyS1O2VnDlwBa0OqzKCG4l+vPhYTbGCRC dqxIohrkhGrACvCCAfiMuSQD X-Received: by 2002:a05:6000:2dc1:b0:439:fbbc:d593 with SMTP id ffacd0b85a97d-43d292e14b3mr10596467f8f.27.1775316419632; Sat, 04 Apr 2026 08:26:59 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it (host-87-9-100-184.retail.telecomitalia.it. [87.9.100.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e4f1a99sm28059462f8f.32.2026.04.04.08.26.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Apr 2026 08:26:59 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Quentin Schulz , Rasmus Villemoes , Tom Rini Subject: [PATCH v2 4/7] cmd: part: support lookup by UUID Date: Sat, 4 Apr 2026 17:23:31 +0200 Message-ID: <20260404152640.3297713-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260404152640.3297713-1-dario.binacchi@amarulasolutions.com> References: <20260404152640.3297713-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="KOKe1Q4/"; 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 --- 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 975a0a08a99d..c46ed25f37aa 100644 --- a/cmd/part.c +++ b/cmd/part.c @@ -139,6 +139,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) @@ -309,13 +313,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"