On Tue, May 28, 2019 at 9:28 PM Samuel Sieb <samuel(a)sieb.net> wrote:
The /boot/efi partition is a FAT-formatted partition that is specially
marked for the firmware to find. It is possible for the grub configs to
be there, but Fedora doesn't put them there. That's how it has been
until now. I don't know for sure where the BLS files go.
Fedora does put the grub.cfg on the EFI system partition at
/boot/efi/EFI/fedora/grub.cfg - which is not how upstream does it.
Upstream GRUB expects grub-install creates an EFI OSLoader binary that
points to where GRUB stores its files which is /boot/grub (upstream
doesn't tack on a '2' to everything, that's a Red Hat / Fedora
convention). And hence much confusion ensued on Fedora, where to point
grub2-mkconfig -o
There are two symlinks on all Fedora installations:
lrwxrwxrwx. 1 root root 22 May 20 11:14 grub2.cfg ->
../boot/grub2/grub.cfg
lrwxrwxrwx. 1 root root 31 May 20 11:14 grub2-efi.cfg ->
../boot/efi/EFI/fedora/grub.cfg
Blek. I don't like it. But that's the way it is.
BLS files always go in /boot/loader/entries on Fedora - that is from
the fully assembled file system and user space perspective. The
original bootloaderspec just says $BOOT/loader/entries where $BOOT is
the EFI system partition, but Fedora doesn't do that out of the box.
You can retrofit it after installation to do it the systemd-boot way,
and kernel-install supports it (I'm not sure if it only supports /boot
as the mount point for the EFI system partition or also /efi)
The BLS files are probably in the /boot partition, same as the
grub.cfg
now. My understanding is that the grub.cfg file is still the initial
file loaded and it points to where the BLS files are. (I really need to
install a system to see how this really works.) You can still add your
own entries to the grub.cfg to do other things. Or you could probably
make a BLS file to point to the other OS grub.cfg.
BLS files have limited keys, unlike grub.cfg's many commands available
- BLS format is similar to the GRUB Legacy *conf file format, except
no such concept of physical devices or volumes. All paths in the conf
file is relative to the volume the conf file is on.
If both installs are using BLS, then you could add something to the
main
grub.cfg to point to the other set of BLS files as well. In the end,
you either have to have separate EFI boot entries for the installs or
one of the installs has to have the master config.
Another thing I just thought of: everytime a new kernel is installed
it writes to grubenv the saved_entry variable, setting the most
recently installed kernel title. That's now the default boot.
I'm not really sure of a good work around for that, other than manual
intervention. In particular you'd want to disable the hidden grub menu
variable in grubenv, so that you have a chance of seeing and changing
what will boot.
--
Chris Murphy