From: Gary Bisson <gary.bisson@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [PATCH] disk: part_efi: update partition table entries after write
Date: Tue, 26 Jan 2021 16:16:54 +0100 [thread overview]
Message-ID: <YBAyZochbuU/YYcJ@p1g2> (raw)
In-Reply-To: <a7be29d7-4534-a059-fd85-2300223cb4bd@gmx.de>
Hi Heinrich,
On Tue, Jan 26, 2021 at 04:08:13PM +0100, Heinrich Schuchardt wrote:
> On 26.01.21 14:56, Gary Bisson wrote:
> > Fixes fastboot issues when switching from mbr to gpt partition tables.
> >
> > Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> > ---
> > Hi,
> >
> > I hesitated calling this a RFC as I'm not sure everyone will like the
> > idea.
> >
> > Basically the issue encountered was the following:
> > - Device with its storage flashed with a MBR partition table
> > - Run fastboot to flash a new OS (and new partition table)
> > - After flashing a GPT partition table, U-Boot couldn't find any of the
> > partition names from the GPT
> > -> reason is that the partition table entries aren't updated
> > -> so U-Boot still believes it's a MBR table inside and so its parsing
> > fails
> >
> > This commit adds an update of the table entries inside the
> > write_mbr_and_gpt_partitions() function. At first I thought maybe this
> > should be added in fastboot file (fb_mmc.c) but couldn't think of a good
> > reason why this shouldn't happened in part_efi directly.
> >
> > Let me know if you have any questions.
> >
> > Regards,
> > Gary
> > ---
> > disk/part_efi.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/disk/part_efi.c b/disk/part_efi.c
> > index 2f922662e6e..7a24e33d189 100644
> > --- a/disk/part_efi.c
> > +++ b/disk/part_efi.c
> > @@ -867,6 +867,9 @@ int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf)
> > return 1;
> > }
> >
> > + /* Update the partition table entries*/
> > + part_init(dev_desc);
> > +
> > return 0;
> > }
> > #endif
> >
>
> This change is for GPT only. Don't we need the same for MBR partition
> tables (write_mbr_partitions())?
I actually have another commit for the MBR partition[1], I just wanted
to send the GPT one first to see if it was an acceptable approach.
Regards,
Gary
[1] https://github.com/boundarydevices/u-boot-imx6/commit/5fc23bce
next prev parent reply other threads:[~2021-01-26 15:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-26 13:56 [PATCH] disk: part_efi: update partition table entries after write Gary Bisson
2021-01-26 15:08 ` Heinrich Schuchardt
2021-01-26 15:16 ` Gary Bisson [this message]
2021-01-27 6:33 ` AKASHI Takahiro
2021-01-27 18:50 ` Heinrich Schuchardt
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=YBAyZochbuU/YYcJ@p1g2 \
--to=gary.bisson@boundarydevices.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