From patchwork Sun Apr 26 15:40:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4567 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 79C693F36A for ; Sun, 26 Apr 2026 17:41:07 +0200 (CEST) Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-48a5952c635sf49595635e9.2 for ; Sun, 26 Apr 2026 08:41:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1777218067; cv=pass; d=google.com; s=arc-20240605; b=ZgrnWT7VVNDQ3NKdmwfy05y/uiFSPR9/aDRHRCvOdW4OPHXtQwGYLdkbHBADoty8d+ 2v3lu4wuorJt7t5kw4qJqbUzcDrpBJ6H2yHKxyC5YaO1fICyIwf2WKJCfBToIB3cB7wX Z+qBvcNMYK/QtYQK97l3iLwRerGkIkf/FpA1TnmYVivZqnmMLaOWEWtN1X1a+Tg2UuXp AX7Xc8HhnJkduRACV3+CsBhDDoDvt6FwmyOZxMQtoe/R25mxO9ECrbGLwXah2NL6HBku Jwm7Njl4vS+LJ5gxze64P5xhNd0PNYv1pPKJv/4WxuxYfUpnOBbgcHSY66vrAX6sLbTv ED7w== 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=PmVYhjG/rBrqSoDDyicoYHb60bJ7yuGunijJD/EMxEQ=; b=bmuAPODJm6F8Vp1nFVxRm68sByf1kCllTxn02LRDnkYzRNhC89yd3txWtFed65sRpX d/bciEdxqMjAx2qccdw700kHaXl3JbXSO0alqAkx5x5GTSsOtV/luLEBDq0pwWs5gqjO 0UHhtisw4f7Q4AoyeJQicC4TzvhTd0ROKj0xutJWpKShZhssxo9/0B45tVy86So9P9rQ lCa24l/cX0cznBsB0SEcMuy1wMmy71nDAeqMNGfG5Bdp4jhEMAyoL3PUhxuaxHjxXp/X W/BqBbbHun4ceAFNUBI3EnC8R8RI4hlaCcQz/OteDjB5czOm+CEN+crdTsCt2s9Tr5VG gU9A==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kh2mEEqg; 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=1777218067; x=1777822867; 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=CErrIke4zpmYx2yQFJiB3il4AsFCkgcFt3F8BfkDTBVkx70fYwTB5xj6N3VQVqAUSa 2Z7Wt5ZB7EJpAvX2CS62+665aOXg2POjiurqrLaVA/WO52ox3HQmKFwS3pWvWRS96oWv El/lasY6TldimVzpD8VPNi9G7fDaJkmPYH8uw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777218067; x=1777822867; 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=nQty2oh3nhA3288CyAW0xrlwD+BuWCiyy7K8DRDhJ3k3OSESi701psHKGop48IADAG vDizmakB4Rx3ltnAs8gRzVhN9nTXI6aGzdGf6I14o7Hq0x5M0L1fRyXFFPssgvATSDM1 mFHuE4LaV2LT1RalwaxwWEC3tRK1EFolAzdog0AiLrbvcUolIYi3Pg3v8QqWKrq2U/mI yVOcLMDWclgQdWYMf0Vq1J6yTdg/EDpw7Zs4SNhtZS8Qq7cY1WQobmpDCMxM56J2X8uR 78EdoW4e3+Wqps28JvXIvajriFwTQqvylOSl8q6c7I6F/gh1NOoH+zTBzCT1u2d2e++2 5dkw== X-Forwarded-Encrypted: i=2; AFNElJ+y834qBxSbDluq8AH7g5Gc3bYQG8gQohS5dpDLa9nQKPqdQ5naVNy6WqU2GMwjaI3q+zqR+mQoPh10XClX@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yy4AHZeIlv1gimqV/D0Ss6Xz9lgN6VkXKu15S1EaCRBcBirxnZg gJ58TNlsnHsnvlUsxcLTfdOn+6HqYQTwEpP38fxhFztuoSomIz5DPNhWsvBtb2xuv2zL/JXr+6G HWg== X-Received: by 2002:a05:600c:4714:b0:48a:5574:3a5d with SMTP id 5b1f17b1804b1-48a55743e96mr351626285e9.7.1777218067022; Sun, 26 Apr 2026 08:41:07 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiIS8jlmZHxsE7AGquZEIcLSNd4bWH6YbB1ovMmgdYUsUA==" Received: by 2002:a05:600c:4686:b0:48a:44bc:d6f4 with SMTP id 5b1f17b1804b1-48a44bcd907ls53448435e9.0.-pod-prod-08-eu; Sun, 26 Apr 2026 08:41:05 -0700 (PDT) X-Received: by 2002:a05:600c:41d6:b0:487:2439:b7c8 with SMTP id 5b1f17b1804b1-488fb745294mr345313625e9.1.1777218065303; Sun, 26 Apr 2026 08:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777218065; cv=none; d=google.com; s=arc-20240605; b=L7QwjnvDthUoNIaNKqsY2R83LTPG2rfsbOTCB/QIG+n8PcJEILg03pSqZTgzB78U6u PM8NBLJ1EKjdvMxu8cfBgWXLLy3PN14W6ijjPFvbl/Z+itcW40J3JTsuxZMhSJiZFHRt L40s72JaDK9IrHrZD1U8j1Tuk455Ao4ghDZBlQj6zinawGpQtGJhJs6/N96QTeS2mlM+ u7PBTzXDRvSsqcujaE9cchn4WXuU3fch/bqpiv9R+2Hy+a/YRCH4Q1/NQLtjw3Aybtb5 mxKYQBnOUVIsSyxVAbw57sRDSTkYHyHn7DwaE61gWFZvP6w1Zb2ilvlHOm2iXQcgNLvl M6Fg== 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=/Q9I6E+fkF6NOPQEns556/DWN091er+VFMWUljXVtro=; b=SM6pdLa4TAPhCEfU+sLjXgmHhyubbkxmM+4ogKc+6ewvbikTSIjr45UlfFJY1e8U35 XMG86OxwQZn987eQRHajKTVkv2R1v7apyg6bd9iMHNs6Rg0QdaKNUjTFb32jFt68ZZf8 SkMpC8mbSO6wKG6yqxJ52GssW5/GpuyO6wcyBRdyiCEkuRtRA90T1/fJj99ik+J3azSi fSaOTUWLbWKZhXcrXzqG/KjcpYlT9xB6xaRO216I7UIJZfeFw4X0qR5yQNfRg0hVRTZ6 zUZSlTkAOkq9x0hVMXiwHGUqQEJYF7YkxEYIBYf1CP6mknSFMntl4XDB5oPv7d4mRCCS lT9w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kh2mEEqg; 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-488fc14cb77sor37864655e9.10.2026.04.26.08.41.05 for (Google Transport Security); Sun, 26 Apr 2026 08:41:05 -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: AeBDiev1qtPjt9SCLEYIWknnrSi9Rq4qwRX970sqSI+c+NbHAG0jsnpcCC2ABapEr3/ T3ZBcvdYJPAP+2ZR/+TqKxZeKoDAXeige6kcZ7BiAOTyWbf3v1axmkxVmx6oAsHdlvqPUFW74wm EQajZpaWUsZT20ryWILN8BjdsyjQsdV2sLkBLzunihC9rETLo20sEo07H/lsaR+5ABgfz5BYnao vIz8hbgtGuAcdQ6ChQ8hTLFqSFjb6O0hjiPe+C4hcC9aHslLkUHG7cVL8Ksavz90HmpGlNxMgnT n9iqpNhi/GjaP322CWttJQLd8NJF3JQljLEr0E8jC8wsOjJRsc3yFdbAFz9cF0QsDp1iVJNighL 8fYgrhcZ+swsMT4oaPDqQ8DcETiT2MGlMVfx8+4Yu6j6p6VOULHbl+riM50rPz2bx2AXeCPAU6i jNT33tpqwmU2C5vnZp6pQ7pc3otzNQwsiAHAn84Nz2F20c550Z+B1xaZ3ps2vRqPLqUjyoF5zjo RA6Oo/0MYbCEyvjmzlE0KBnETScckAA3CBwir3uQwMguhAdluzEh02VubEkfdmTaWZtCXToJ1w3 VQt14x6hkkoqsW6RUHxPLgv9/5isGw== X-Received: by 2002:a05:600c:45d3:b0:48a:5821:5ffc with SMTP id 5b1f17b1804b1-48a58216a4bmr327190065e9.2.1777218064846; Sun, 26 Apr 2026 08:41:04 -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-4891bb3d121sm802593765e9.14.2026.04.26.08.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 08:41:04 -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 v6 4/8] cmd: part: support lookup by UUID Date: Sun, 26 Apr 2026 17:40:36 +0200 Message-ID: <20260426154054.2040932-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260426154054.2040932-1-dario.binacchi@amarulasolutions.com> References: <20260426154054.2040932-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=kh2mEEqg; 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, ....)