| Message ID | 20260328171624.2377527-3-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Hi Dario, On 2026-03-28T17:15:13, Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > diff --git 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) > + } else if (uuid_str_valid(argv[2])) { > + part = part_get_info_by_uuid(desc, argv[2], &info); > + if (part < 0) > + return 1; Please can you update the help for 'part start' and 'part size' as well so they mention UUID? > diff --git 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) > + } else if (uuid_str_valid(argv[2])) { Since you are adding a new feature, could you add a test for this in test/dm/part.c? Regards, Simon To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
diff --git a/cmd/part.c b/cmd/part.c index 975a0a08a99d..a3f3febb6977 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) @@ -314,8 +318,8 @@ U_BOOT_CMD( " - set environment variable to the size of the partition (in blocks)\n" " part can be either partition number or partition name\n" "part number <interface> <dev> <part> <varname>\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 <interface> <dev> <part> <varname>\n" " - set environment variable to the partition name using the partition number\n" " part must be specified as partition number\n"
The 'part number' command currently allows looking up a partition index only by its name. Extend the command to support looking up the partition index via its partition 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. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- cmd/part.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)