[U-Boot] [PATCH v7 9/9] GPT: provide commands to selectively rename partitions

Bin Meng bmeng.cn at gmail.com
Mon Jun 26 01:52:42 UTC 2017


Hi

On Mon, Jun 26, 2017 at 7:43 AM,  <alison at peloton-tech.com> wrote:
> From: Alison Chaiken <alison at peloton-tech.com>
>
> This patch provides support in u-boot for renaming GPT
> partitions.  The renaming is accomplished via new 'gpt swap'
> and 'gpt rename' commands.
>
> The 'swap' mode returns an error if no matching partition names
> are found, or if the number of partitions with one name does not equal
> the number with the second name.   The 'rename' variant always
> succeeds as long as a partition with the provided number exists.
>
> Rewriting the partition table has the side-effect that all partitions
> end up with "msftdata" flag set.  The reason is that partition type
> PARTITION_BASIC_DATA_GUID is hard-coded in the gpt_fill_pte()
> function.  This does not appear to cause any harm.
>
> Changes since v7:
>
> -- Removed several casts in create_gpt_partitions_list() and
>    do_rename_gpt_parts() as suggested by Lothar Waßmann.  The cast of
>    gpt_part_info.name to char* is needed to silence a compiler
>    warning.
>
> -- Substituted simple_strtol() for atoi() in do_gpt_rename_parts() as
>    suggested by Tom Rini and Wolfgang Denk.
>
> -- Fixed bug in do_rename_gpt_parts() where 0 was returned as a valid
>    number of partitions with which to continue.
>
> -- Added a comment to do_rename_gpt_parts() noting that the debug()
>    string it optionally prints is useful as input to the pre-existing
>    'gpt write' and 'gpt verify' commands.
>
> -- Changed some -1 return values to -ENODEV and -EINVAL as suggested
>    by Tom Rini.
>

Can you please remove the changelog from the commit message, instead
put it in the commit-notes section below ---?

>
> Signed-off-by: Alison Chaiken <alison at peloton-tech.com>
> ---
>  cmd/Kconfig    |   8 ++
>  cmd/gpt.c      | 239 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
>  doc/README.gpt |  20 ++++-
>  3 files changed, 261 insertions(+), 6 deletions(-)
>

[snip]

Regards,
Bin


More information about the U-Boot mailing list