From patchwork Sun Apr 26 15:46:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4576 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 43C243F206 for ; Sun, 26 Apr 2026 17:47:37 +0200 (CEST) Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-43d77286244sf6207936f8f.1 for ; Sun, 26 Apr 2026 08:47:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1777218457; cv=pass; d=google.com; s=arc-20240605; b=ZFea88EVBMVix4Df/QbRa03u+7Xkd777+PVl3a0JN6DW01RbSsy+51iVNDWjC19xdE GCqTtqqayMKzru5Za202gJOYNUNOrIDt7FXGShVrkLMHRq1PJd9+kp6e7cVLffIYaq+z 6jJfSk7iaWCRMxzJP4zLUHgvnggW5SizVUIMqJC5t0ikOWASRc0zhS/NKZlTvp+WtwD1 pZIkpQPJ4HNyl9zQ/I8udWX2EmeJHLFLzNdLIfnoeKPj0V/fuxqfYgJYQ/r1/6GBI9QF IvwjsX/QsLdIc60P9F8QIZtmz3VZ3LbkKhjEn69MBT2XVHm1n8d+sm5ZPTP826AWqQcc fdkQ== 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=auHXMD7BZs65vlwN27DGVU1nj2Bg5N9/TQ5iKQcefp8=; b=OBa6Qx5Wb0515448Rd0CjwRRbMtIKtdOp/Grc+SyFCwUDzrZ7fHuR4J0vml1NXkA/J 6vGS4F7lGWeu89BinO/LpV292snoKgJpO8kJyjS6IjEi+AdqsAk1D1TyZ49jg08kEN48 Zp7tJ26zT0oTCURRhDyBgTFtk53Ce2Uy00vrS8Ck/zZyZmh43gPjP8WbjBxVas4uP0Au X16eN00fgohi9WORLHKKVTkmp4b4slyLswWtIJNnFi5THT+X6J6qYDAn8KZrrGrdxnxB MrD0tnHeDtMNcqJCnilIJ5hgozX2JrZOe322uR++lwIufHk09cFl4yXxn4nALUo1MOvH mbAQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Uxy4uB/+"; 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=1777218457; x=1777823257; 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=f7QhZAlhs26o2E4qTJmjnsb3aKqKGwUtP4kwP+oNWI/hThQWRnTdemgmz5tU6V+DlL EMWyUv+OyxYlrhcofFarrJDQuZ6uJvpAZBvN4NnZ4QLEW2Iah193WcQluD7Q9AxWmyJM o9e/PJ0BVTQY5o1WjXHGO76TNq1EJmRQgoif4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777218457; x=1777823257; 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=EYiqdVg2E3fNlT3h8afHc967W7OCmuEAWKISAOGHA476Tggqu5sf+D1aRyTjQww25z 8NiiU3x31aFuUw3K9wCADD3wW/NOxP9pRR2U2cozoK1QBnc+JJHyTjHoYiZ/afapO1qU rQqNj0RB7BIA3Hkp4o9W2GL3LbeKZdaEpzQPJ/WJsCtkJ3AzrOOkTaNOLJGfpiab2KMR VTdj3DJN6XU98RoG7qGmrWCPP0F1ralsulS8uywS/6SmLbU9jcIBLu+gF92d+5sXwajB otIR1TguPEcQHrD6cFHuoY0DLLXmrDvIjfpw5ILju1/1ai+GQcN/vvPz2nnhIKaFxZCp YjyQ== X-Forwarded-Encrypted: i=2; AFNElJ+Ys7VY4cCmBEaV0Zt6JXJryJt1t427JFhCVtSzB63t9bpJybSX4p3PgjTNXwzg+EN4FrgWkutM5B73I/69@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Ywo9kw7M6v2mYnodbrikHb5mozPudA4wrj1OxsLBvwkV/Pn2oPf xbJs59velvHUDwPlYJ3Zp1HMeHONiRihucxh+39P7/vDJsZsHyWhNzmYBuk+VHlhUwY+DA== X-Received: by 2002:a05:600c:3006:b0:487:1108:48b8 with SMTP id 5b1f17b1804b1-488fb739f86mr314154805e9.2.1777218456831; Sun, 26 Apr 2026 08:47:36 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiISv0xUHlgynTaFewSsZaBk5zO1IbR6RGsPil3xRjiRfw==" Received: by 2002:a05:600c:358c:b0:48a:5e23:daaf with SMTP id 5b1f17b1804b1-48a5e23de22ls16017575e9.0.-pod-prod-06-eu; Sun, 26 Apr 2026 08:47:35 -0700 (PDT) X-Received: by 2002:a05:600c:3110:b0:485:3abe:ab86 with SMTP id 5b1f17b1804b1-488fb739ce4mr545355975e9.4.1777218455271; Sun, 26 Apr 2026 08:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777218455; cv=none; d=google.com; s=arc-20240605; b=IuOLs5zXr+p3uO/Mt+3T/ZRjuIeFEauM2xcRPHIBO7LT4zA7VJ2gaCSzQDSeJB2fRh Sd3lsqFcDWDuJhXEZWS09W0j4Z0AJMifUwYTRJCcAj4knQZmjDPAakDX5n3TQ0z/l8w+ 2ViVX2vJ7sZ2UXETWkFg820k5axkENCgpJ3lRr/9hZwv1g9zUJRneL1AxqAzH5DKa0CB kyeer+dgaDWD6Yv6KCkrZYjkWSASDmNdDjfGa139+XDPmf638MGzYwjcWXGmVftn9qVz Kipy7UrRx9+lglvbrQV9GC0zkQdNepkqGicGNRn0hwJODTt1L/UkTaSPVvBWZVf44jNV LO/A== 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=Yglg1I6l70Hhqpjy+qvvk1bg0I29PGNWtGMy8jFzWA8=; b=bh/T56Vz4jT+6NJpVNzdIfmRSLMjusOxxcQzTMqhiL2MgfvZ0SBh8edY4Nr6AzW8bj q+n0qAO3GurXiD8Xg0CeB4EufrXZrc8I564KJWaEYnk9y8bc0F28aSbLPgdWE8HmGn4n w3Uz3v1MS0WtnD1DpcW/BavsDs352DHRFui6EgXe/1jlBietz5KaBdOr2Hd415uJVZQM AUWHbzTujVWE5onHL4vdNNJz5rzOc3y1vK77wUojXhU05y86c8TmDvKhb5vaWZ3v7LK7 UcTLH0y6BjsqFLzKXIu5tyiyP07FPuHP5JPKrz97x8ig7Eq+rOVVTayHwmDRB8GmR0ov +vhQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Uxy4uB/+"; 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-43fe4e0ff27sor3316990f8f.10.2026.04.26.08.47.35 for (Google Transport Security); Sun, 26 Apr 2026 08:47:35 -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: AeBDievCIRY3IDHKVElhRXwHqtofE4p/qcm3nQA+nU3sShEhWl98mkULTBt3F32NiPq aJmh+VBhmzECeLjehuaCcfl7sWat+qs4uFgbnLGnGQC6QlSRLcm0TQadcRmXyHz2RUCt4+cmw+I Ofq8HZf/B4xIS7nIPDxOSvR343X6p0cq1LqsGe78EOC9yfPJdab1c0ICL8vu1H8CxLJh6sOiU+E dji1HxlUifuydIaGqlNc1pr4v2ihWr00OpDbhOi7qm6YPbZyegbptoUSonO5zVJZ/sdONERRii5 OyP9pp/kp+wRS4cEP+ge7FXQc3qiNtejBWg9yFz3OeVn0RiJxjMmjwetZET6j7gcruwnLw9/88o RqZqZa8wml138pQh0d9NbWa1wgsSmuAiyvC1uJcCQJjGKx5Mv8BP8sizNwDd78d1bPQ0Fn0NhWR TrtXMl6gSShin8DQuKTgkXtdWlYXycA2g3WiVKFznBaFxKh5Q4Hd4PAw37XqdlHzhzGVJRUo2oQ 5DUFQVokGaapF8Ubzy8fR4LG7GLmqJiahvyRqMhUDq5vdxYP+TR7ab545u4YcQOfDpM9+m4LWtb b8wK5dqjqZIl+7N1nNSw3aFCc/qmwA== X-Received: by 2002:a05:6000:230b:b0:43d:7cb5:43b2 with SMTP id ffacd0b85a97d-43fe3db3150mr60692893f8f.15.1777218454766; Sun, 26 Apr 2026 08:47:34 -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 ffacd0b85a97d-44123d23e0bsm34489985f8f.15.2026.04.26.08.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 08:47:34 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Simon Glass , Jonathan GUILLOT , Padmarao Begari , Quentin Schulz , Rasmus Villemoes , Tom Rini Subject: [PATCH v7 4/8] cmd: part: support lookup by UUID Date: Sun, 26 Apr 2026 17:46:57 +0200 Message-ID: <20260426154724.2042569-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260426154724.2042569-1-dario.binacchi@amarulasolutions.com> References: <20260426154724.2042569-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="Uxy4uB/+"; 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, ....)