grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [v6 PATCH 2/3] RISC-V: Update image header


From: Leif Lindholm
Subject: Re: [v6 PATCH 2/3] RISC-V: Update image header
Date: Wed, 9 Nov 2022 12:01:21 +0000

On Wed, Nov 09, 2022 at 12:33:58 +0100, Ard Biesheuvel wrote:
> > > Can we get rid of these header definitions entirely?
> > >
> > > The only GRUB code that seems to care about the fields that are not
> > > defined in the PE/COFF spec is grub_cmd_file(), which currently parses
> > > the magic field, but given that we only support EFI boot anyway, that
> > > code should just parse the PE machine type instead.
> >
> > Right, so your patch from August dropped that check in the loader
> > itself. I missed that one.
> >
> > The drawback to that is that not all EFI executables are destined for
> > the Linux loader. So while trying to boot them using the linux loader
> > is definitely user error, that change removed a potentially useful
> > user-visible error message.
>
> The new EFI zboot images don't have the arch specific magic numbers
> either, and those are Linux images too.
>
> So pretending that Linux EFI PE/COFF images are always hybrid images
> that could also boot in bare metal mode is no longer appropriate in
> any case,

Is that true for arm32 as well?

Certainly for arm64, *a* change was needed.

> and we should really just deal with the fact that the linux
> loader and the chainloader are mostly the same thing on EFI-only
> architectures.

Architectures that only support *linux* booting via EFI.
Which arm32 isn't.

*Dealing* with that would mean merging the linux- and chain-
loaders. Not dropping sanity checks and keeping both.

The change may have been the appropriate compromise, but it wasn't
treated as one.

/
    Leif



reply via email to

[Prev in Thread] Current Thread [Next in Thread]