[PATCH 1/3] cmd: fix gpt setenv

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Mon Aug 28 10:11:55 CEST 2023


On 26.08.23 04:04, Simon Glass wrote:
> On Fri, 25 Aug 2023 at 19:53, Heinrich Schuchardt
> <heinrich.schuchardt at canonical.com> wrote:
>>
>> Do not assume that partitions are continuously numbered starting at 1.
>>
>> Having a partition table with a single partition 63 is valid.
>>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
>> ---
>>   cmd/gpt.c | 6 ++----
>>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg at chromium.org>
> 
> I would like to have a map / list of the partition on a disk for
> bootstd. At present we iterate through a lot of partitions that are
> not present.
> 
> What do you think?
> 
> Regards,
> Simon

Reading the partition table and buffering it is possible in principle. 
This is what Linux does. But you have to remember that there are 
multiple commands that can overwrite the partition table, e.g.

* gpt write
* mbr write
* mmc write
* nvme write
* sata write

Or there could be a user action like swapping the SD card.

So you will need an invalidation logic for the buffer.

How much boot time could you save on an embedded board?

Best regards

Heinrich


More information about the U-Boot mailing list