U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anshul Dalal <anshuld@ti.com>
To: Rasmus Villemoes <ravi@prevas.dk>, <u-boot@lists.denx.de>
Cc: Quentin Schulz <quentin.schulz@cherry.de>, Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v3 0/2] 'part name' subcommand and some robustification
Date: Tue, 11 Nov 2025 10:37:16 +0530	[thread overview]
Message-ID: <DE5LSEDXZJVV.HJ2G7BOFCC8@ti.com> (raw)
In-Reply-To: <20251110205411.4075351-1-ravi@prevas.dk>

On Tue Nov 11, 2025 at 2:24 AM IST, Rasmus Villemoes wrote:
> Implement a "part name" subcommand, mirroring the existing "part
> number" subcommand.
>
> In the discussion for v1 of that, it came up that there's a bit of
> inconsistency in how much and what one can assume to be initialized in
> 'struct disk_partition' after a successful call of one of the
> get_info* family of functions. Patch 1/2 tries to consolidate
> that by making sure all ->get_info invocations go through a common
> helper that at least always initializes the string members.
>
> Quentin, I've taken the liberty of including your Acks, as the
> incremental diff in patch 1 is quite minor, but do speak up if I
> should not have done that.
>
> v3: Make sure part_get_type_by_name() can only ever return 0, -ENOSYS
> (in case ->get_info is not implemented) and -ENOENT, rather than
> anything that ->get_info might return.
>
> v2: https://lore.kernel.org/u-boot/20251020121100.1742812-1-ravi@prevas.dk/
>

For the entire series:

Tested-by: Anshul Dalal <anshuld@ti.com>

Logs (on TI AM62x):

	=> part
	part - disk partition related commands

	Usage:
	part uuid <interface> <dev>:<part>
	    - print partition UUID
	part uuid <interface> <dev>:<part> <varname>
	    - set environment variable to partition UUID
	part list <interface> <dev>
	    - print a device's partition table
	part list <interface> <dev> [flags] <varname>
	    - set environment variable to the list of partitions
	      flags can be -bootable (list only bootable partitions)
	part start <interface> <dev> <part> <varname>
	    - set environment variable to the start of the partition (in blocks)
	      part can be either partition number or partition name
	part size <interface> <dev> <part> <varname>
	    - set environment variable to the size of the partition (in blocks)
	      part can be either partition number or partition name
	part number <interface> <dev> <part> <varname>
	    - set environment variable to the partition number using the partition name
	      part must be specified as partition name
	part name <interface> <dev> <part> <varname>
	    - set environment variable to the partition name using the partition number
	      part must be specified as partition number
	part set <interface> <dev> type
	    - set partition type for a device
	part types
	    - list supported partition table types
	=> part list mmc 1

	Partition Map for mmc device 1  --   Partition Type: DOS

	Part    Start Sector    Num Sectors     UUID            Type
	  1     2048            262144          076c4a2a-01     0c Boot
	  2     264192          417336          076c4a2a-02     83
	=> part name mmc 1 1
	mmcsdb1
	=> part name mmc 1 2
	mmcsdb2

Regards,
Anshul


> Rasmus Villemoes (2):
>   disk/part.c: ensure strings in struct disk_partition are valid after
>     successful get_info
>   cmd/part.c: implement "part name" subcommand
>
>  cmd/gpt.c              |  4 +--
>  cmd/part.c             | 16 ++++++++++-
>  disk/part.c            | 63 +++++++++++++++++++++++++-----------------
>  doc/usage/cmd/part.rst | 13 +++++++++
>  include/part.h         | 16 +++++++++++
>  5 files changed, 83 insertions(+), 29 deletions(-)


  parent reply	other threads:[~2025-11-11  5:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 20:54 [PATCH v3 0/2] 'part name' subcommand and some robustification Rasmus Villemoes
2025-11-10 20:54 ` [PATCH v3 1/2] disk/part.c: ensure strings in struct disk_partition are valid after successful get_info Rasmus Villemoes
2025-11-11  5:18   ` Anshul Dalal
2025-11-11  7:58     ` Rasmus Villemoes
2025-11-10 20:54 ` [PATCH v3 2/2] cmd/part.c: implement "part name" subcommand Rasmus Villemoes
2025-11-11  5:25   ` Anshul Dalal
2025-11-11  8:00     ` Rasmus Villemoes
2025-11-11 17:27       ` Quentin Schulz
2025-11-11  5:07 ` Anshul Dalal [this message]
2025-11-18 20:32 ` [PATCH v3 0/2] 'part name' subcommand and some robustification Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DE5LSEDXZJVV.HJ2G7BOFCC8@ti.com \
    --to=anshuld@ti.com \
    --cc=quentin.schulz@cherry.de \
    --cc=ravi@prevas.dk \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox