Re: FreeBSD 14.1 and UEFI boot ignores bootme flag

From: Warner Losh <imp_at_bsdimp.com>
Date: Tue, 13 Aug 2024 20:27:38 UTC
On Tue, Aug 13, 2024 at 2:02 PM Chris <bsd-lists@bsdforge.com> wrote:

> On 2024-08-13 10:23, Tomek CEDRO wrote:
> > On Tue, Aug 13, 2024 at 3:30 PM Daniel Braniss <danny@cs.huji.ac.il>
> wrote:
> >> (..)
> >> At some point I succeeded in deleting the dvd, but now I see its back.
> >
> > This may be added by BIOS / Setup :-)
> >
> >> So how do I add a second boot partition?
> >
> > Use efibootmgr as imp suggested and add another entry with desired
> > boot information, you may then select this new entry as the default.
> > It will show up in BIOS / Setup menu and you can change order over
> > there.. but the entry needs to be added with efibootmgr :-)
> >
> > No worries I had the same problem too some time ago, also found
> > reference to bootme flag which did not work (should be removed from
> > man pages?). Now I sometimes use F8 at boot to select different system
> > to boot.. but there are good looking menu like bootloaders for UEFI
> > like reEFInd [1], Clover [2], LibreBoot [3]. Maybe we need some more
> > documentation on this? :-)
> >
> I too found efibootmgr(8) unnecessarily cumbersome. So much so, that I
> ended
> writing
> a script to use it more effectively.
>

Yea. it's designed to be Linux compatible, but it's a bit cumbersome to use.
It has the advantage of being unambiguous, though.


> In the end I downloaded a refind [1] image. Wrote it to a USB stick,
> booted
> it and
> installed it. It's dead simple, just does the right thing, and just works.
> Almost never
> need to futz with anything. I'm no stranger to (U)EFI or the boot process.
> But IMHO
> FreeBSD is not (average) user friendly in the (multi) boot department.
> Either
> multiple
> FreeBSD, or OS's. Maybe I should make a port out of refind, or get
> permission
> to integrate
> some of it into $BASE.
>

REFInd is GPL'd, so that no can do.


> 1.) https://en.wikipedia.org/wiki/REFInd
>
> I'm currently using the 13.3.2 flashdrive image on a 15-current install
>
> https://sourceforge.net/projects/refind/files/0.13.1/refind-flashdrive-0.13.2.zip/download
>
> I simply unpacked it, and performed dd if=./refind-flashdrive-0.13.2.img
> of=/dev/da0 bs=1m
> I'm booting FreeBSD, OpenBSD, Slackware, and Windows11 on the laptop I'm
> writing this from.
> In your computer setup; simply choose refind as your default boot, and
> your
> done.
>

Yea, I've often thought that having a UEFI Menu choice for booting one of
the many eifbootmgr options would be good to have. You can kinda sorta do it
by having a good boot order and setting BootNext and exiting the boot
loader,
but there can be some issues if there's no efibootmgr entry for an OS.

Expanding the EFI lua bindings would be it possible to do nearly everything
that REFIND can do. All the building blocks are there, but nobody's found
the
time to put them together.

Also, gptboot.efi, though undocumented, makes the ping pong of nanobsd
trivial. But even better is to use BEs with ZFS. I've largely moved to
doing this
for most things since it's so much more flexible...

Warner


> HTH
>
> --Chris
>