[PATCH 3/7] efi: test: Create a disk image with and EFI app in it

Simon Glass sjg at chromium.org
Tue Nov 21 23:10:45 CET 2023


Hi Heinrich,

On Tue, 21 Nov 2023 at 10:37, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> On 11/21/23 12:35, Simon Glass wrote:
> > Create a new disk for use with test, which contains the sandbox
> > helloworld app. This will be used to test the EFI boot bootmeth.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> >   test/py/tests/test_ut.py | 32 ++++++++++++++++++++++++++++++++
> >   1 file changed, 32 insertions(+)
> >
> > diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py
> > index 1d9149a3f683..f6220c05238a 100644
> > --- a/test/py/tests/test_ut.py
> > +++ b/test/py/tests/test_ut.py
> > @@ -468,6 +468,37 @@ def test_ut_dm_init(u_boot_console):
> >       with open(fn, 'wb') as fh:
> >           fh.write(data)
> >
> > +
> > +def setup_efi_image(cons):
> > +    """Create a 20MB disk image with an EFI app on it"""
> > +    mmc_dev = 7
> > +    fname, mnt = setup_image(cons, mmc_dev, 0xc, second_part=True)
>
> If you would set the partition type GUID to ESP, U-Boot would stop to
> complain about EFI variable that cannot be persisted.

Doesn't that need a GPT partition type?

We do use that for the ChromeOS bootmeth (in setup_cros_image) so we
could use it here too.

>
> There is a pending patch that wants to make the failure to persist EFI
> variable fatal.
>
> [RESEND,v2] efi_loader: Fix UEFI variable error handling
> https://patchwork.ozlabs.org/project/uboot/patch/20231113161031.138304-1-o451686892@gmail.com/

Regards,
Simon


More information about the U-Boot mailing list