On Monday, 24 May 2021 14:11:00 BST Peter Humphrey wrote:
> On Friday, 21 May 2021 20:06:25 BST Michael wrote:
> > On Friday, 21 May 2021 15:42:01 BST pe...@prh.myzen.co.uk wrote:
> > > Hello list,
> > > 
> > > Mynew machine has Win-10 installedon /dev/nvme0n1 with the ESP as
> > > partition
> > > 1. I want to install Gentoo on /dev/nvme1n1. So far I haven't found a
> > > way
> > > to set up a working boot arrangement. I've tried mounting the ESP on
> > > /efi,
> > > on /EFI and on /boot/EFI. Efibootmgr seems to write a boot entry in some
> > > of
> > > those cases, and it's still there after a reboot - but it isn't visible
> > > to
> > > the BIOS.
> > > 
> > > Can anyone offer some enlightenment, please?
> > 
> > If your ESP is on /dev/nvme0n1 and you are using vmlinuz symlinks, you can
> > use /boot/EFI as the mountpoint for the ESP VFAT partition.  Your
> > kernels/config/ System.map/initrd.img files will go into /boot, which will
> > be on the same fs as / on /dev/nvme1, using a fs which supports symlinks.
> > 
> > The efibootmgr '--loader' option should/could be used to specify the path
> > to your bootloader image, or if you are not using a bootloader image to
> > chainload your kernel with, point it directly to the path of your kernel;
> > e.g.
> > 
> > efibootmgr --create --disk /dev/nvme0n1 --part 1 --label "gentoo-5.10.27"
> > \
> > --loader "\EFI\gentoo\gentoo-5.10.27.efi"
> > 
> > The BIOS/UEFI menu should be able to list entries of bootable *.efi
> > images,
> > as long as they are within the subdirectory of /boot/EFI on the ESP, but
> > if
> > you are using a bootloader, then it is the bootloader image which will run
> > and chainload your OSs and their kernels.
> 
> Thanks Michael. I've finally got it booting, by resorting to the same hack
> as I did on my previous machine.
> 
> Using efibootmgr to add a UEFI boot record does create it, but selecting it
> in the BIOS fails and it just drops to the next in line: Windows 10. No
> adjustments to the --create command resulted in a bootable system, so I had
> to run bootctl-install as well and then remove the hex-numbered directory
> and restore my own loader.conf. I spent days wrestling with this.
> 
> It's clear that I just don't understand UEFI booting. It sounds simple
> enough, but it clearly isn't. I've read everything I could find on the
> subject, to no avail.

Peter, what efibootmgr stanza do you use to create your UEFI boot records?  It 
seems the UEFI firmware fails to process what you provided and proceeds to the 
next bootable option (Windows 10).

Typically you would either run efibootmgr to inform the UEFI firmware of your 
OSs kernels directly, or you would engage the services of a boot manager to 
list and boot your chosen OS.  In the former, the UEFI firmware will boot the 
OS directly.  In the latter, the UEFI firmware will load the boot manager and 
then the boot manager will select and boot the OS.

The process for updating the UEFI boot menu with available kernel images using 
the efibootmgr command, is different to updating the boot menu of a 3rd party 
boot manager.  The two are not related, other than ultimately loading the 
selected kernel/initrd.

Something you should note is unlike 3rd party boot managers, the UEFI firmware 
cannot boot directly symlinked vmlinuz and initrd.gz files.  This is because 
the UEFI parses the contents of the ESP, which is formatted in VFAT - a 
filesystem which does not support symlinks.  In this case, a 3rd party boot 
manager will be launched by the UEFI firmware from within the ESP, which will 
be in possession of required 'os-prober' and filesystem drivers to access and 
launch the OS kernel/initrd image from your root partition.

You can contact me off list if you want to work through the detail of 
configuring your system with and without a boot manager.  I think once it 
clicks, you'll be able to apply your preferred solution without much trouble 
in the future.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to