All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 0/2] Extend 'part' cmd and C API to get part info
@ 2019-06-14 13:04 Igor Opaniuk
  2019-06-14 13:04 ` [U-Boot] [PATCH v4 1/2] cmd: part: Add 'number' sub-command Igor Opaniuk
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Igor Opaniuk @ 2019-06-14 13:04 UTC (permalink / raw)
  To: u-boot

This patch-series extends `part` cmd and disk/part C API for getting
partition info by it's name:

1. part "number" sub-command serves for getting the partition index from
partition name. Also it can be used to test the existence of specified
partition.

2. Introduces part_get_info_by_dev_and_name_or_num() function which
allows us to get partition info from its number or name. Partition of
interest is specified by string like "device_num:partition_number" or
"device_num#partition_name".

Initially these patches were a part of
"android: implement A/B boot process" [1] patch-series, but then
due to multiple requests decided to send it separately, while the
work on A/B series is still in progress.


Use case:

For example, in Linaro Lab this U-Boot command for automatic testing
of Linux rootfs is used:

    => setenv bootpart 1:f

where 0xf is "userdata" partition. But the number of "userdata"
partition can be changed any time, when partition table is changed.

So it would be nice to get rid of that 0xf magic number and use
partition name instead, like this:

    => part number mmc 1 userdata part_num
    => setenv bootpart 1:${part_num}


[1] https://patchwork.ozlabs.org/cover/1044152/

Ruslan Trofymenko (2):
  cmd: part: Add 'number' sub-command
  disk: part: Extend API to get partition info

 cmd/part.c     | 16 +++++++++++-
 disk/part.c    | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/part.h | 21 ++++++++++++++++
 3 files changed, 104 insertions(+), 1 deletion(-)

--
2.17.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-14 13:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 13:04 [U-Boot] [PATCH v4 0/2] Extend 'part' cmd and C API to get part info Igor Opaniuk
2019-06-14 13:04 ` [U-Boot] [PATCH v4 1/2] cmd: part: Add 'number' sub-command Igor Opaniuk
2019-06-14 13:26   ` Roman Stratiienko
2019-06-14 13:52     ` Igor Opaniuk
2019-06-14 13:56       ` Eugeniu Rosca
2019-06-14 13:04 ` [U-Boot] [PATCH v4 2/2] disk: part: Extend API to get partition info Igor Opaniuk
2019-06-14 13:56 ` [U-Boot] [PATCH v4 0/2] Extend 'part' cmd and C API to get part info Igor Opaniuk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.