On Tue 15 Feb 2022 at 14:20:55 (-0500), Felix Miata wrote:
> David Wright composed on 2022-02-15 10:11 (UTC-0600):
> 
> > Is anything else required for B to become a "native EFI" installation?
> 
> > This conversion process will, I think, make the system boot into
> > the EFI-ed B by default. If I want to make E boot by default again,
> > should I boot E and run update-grub and grub-install?³
> > Or should I do this by running efibootmgr?
> 
> Without changing GRUB_DISTRIBUTOR= in /etc/default/grub, you'll wind up with 
> only
> /boot/efi/EFI/debian. It will be just like MBR booting, where the last updated
> Grub overwrites what the previous one put in the MBR. I avoid this by 
> changing the
> default
> 
>       GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
> 
> to e.g.
> 
>       GRUB_DISTRIBUTOR="bookworm"

That was useful — I hadn't realised the connection between that
variable and the directory name in EFI/. It's quite tricky pulling all
the threads together: the directory layout in EFI/, all the stuff
that's in /sys/firmware/efi/efivars, the efibootmgr's listing, and
the contents (and actions) of the EFI menus when you boot into the
firmware interface (reached with Esc F9 here, IIRC).

> Once you have a unique /boot/efi/EFI/ entry for each installation, you 
> /should/ be
> able to switch which has control either in the BIOS directly, or with 
> efibootmgr.
> Likely update-grub and grub-install would do the same thing, but I've never 
> given
> them the opportunity here. I say /should/ because some UEFI BIOS are finicky
> beasts that can't always be trusted to do as expected.
> 
> I avoid the issue of priority usurpation in two ways:
> 1-only mount the ESP filesystem to /boot/efi/ on one installation
> 2-don't install any bootloader

I think I've decided to keep mine simple by:
. booting into one primary system from the ESP,
. only that primary system has /boot/efi/EFI/ mounted (your 1),
. no Grub on the non-primary systems (your 2),
. the primary's Grub will choose which system to boot.

I'm used to using grubenv for one-time boot selection, even when
I'm not at the machine, but am happy to use the EFI menus whenever
I need to boot from a stick, etc.

> I actually boot from /boot/grub/custom.cfg, by copying /etc/grub.d/40_custom 
> to
> 06_custom. This causes grub-mkconfig to generate a grub.cfg that displays my
> custom.cfg entries before its auto-generated entries, minimizing need to 
> scroll
> the menu to find a desired selection. My custom.cfg boots via kernel and 
> initrd
> symlinks (and volume LABEL rather than UUID, same as fstab), so infrequently 
> has
> any need to be updated. Note that my use of singular filenames is inaccurate, 
> as I
> have 5 UEFI systems configured this way, and all have 10 or more Linux 
> installations.

I'll probably go through another iteration of my edgrub
script, to reduce even more of the "garbage" in grub.cfg.
Thanks for the suggestions.

Cheers,
David.

Reply via email to