[U-Boot] [PATCH v5 3/3] rename GPT partitions to detect boot failure

Wolfgang Denk
2017-06-10T06:51:38Z

Dear Alison,

In message <1497072917-16614-1-git-send-email-alison@peloton-tech.com> you wrote:
>
> This patch provides support in u-boot for renaming GPT
> partitions. The renaming is accomplished via a new 'gpt flip'
> command.
>
> The concept for the bootloader state machine is the following:
>
> -- u-boot renames ‘primary’ partitions as ‘candidate’ and tries
> to boot them.
> -- Linux, at boot, will rename ‘candidate’ partitions as
> ‘primary’.
> -- If u-boot sees a ‘candidate’ partition after a boot attempt,
> it tries to boot the ‘backup’ partition.

I think you are talking about two parts here, and I strongly feel
these should be kept separate.

The first part is support for renaming GPT partitions. The idea is
clean, but should it not rather be kept general and let the user
provide the new name as argument, i. e. implement a generic
"gpt rename" command instead of a hard-wired "gpt flip"?

The second part is the flipping of the partition names. This is in
my opinion policy, and should also not be hardwaired into this
command, but left to the user. Maybe I do nmot want to fall back to
the ‘backup’ partition after a single boot attempt, but instead try
other things first, like booting another kernel or another device
tree blob?

I feel this should be not so much hardwired, but leave more freedom
for the user's creativity.

What do you think?

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
...computer hardware progress is so fast. No other technology since
civilization began has seen six orders of magnitude in performance-
price gain in 30 years. - Fred Brooks, Jr.