Should/does loader.efi respect the "bootme" GPT attribute ?

Warner Losh imp at bsdimp.com
Tue Dec 15 15:58:41 UTC 2020


On Tue, Dec 15, 2020 at 7:00 AM Poul-Henning Kamp <phk at phk.freebsd.dk>
wrote:

> It looks to me like the GPT attributes "bootme", "bootonce" and
> "bootfailed"
> are unknown to loader.efi ?
>

BIOS "loader" doesn't respect these flags either. That's done by gptboot.
The equivalent in UEFI land is gptboot.efi.


> Is this intentional or should it be fixed ?
>

It is intentional. UEFI really doesn't want you using non-standard
partition flags to determine boot order. We provide a way to do it with
gptboot.efi, but UEFI makes it hard to support. loader.efi is kinda late in
the process anyway, and it's main loop makes supporting gptboot-like
functionality hard due to the way things are ordered and how gptboot
rewrites the GPT partition table at different points in the boot. UEFI has
its own bootnext protocol, that works in conjunction with the EFI
environment variables to have a more robust, less 'guess what I mean'
approach. So all in all, it's hard, non-standard and doesn't play well with
UEFI.

I wrote gptboot.efi for USB sticks where we have two systems installed that
travel from system to system. It's a bit hacky, but I needed something that
worked in a mixed UEFI and BIOS environment that was in place at our system
integrators. There's some times you gotta not play well, but this won't
work everywhere :)

Warner


More information about the freebsd-hackers mailing list