Code: Select all
grub-install --target=x86_64-efi --boot-directory=/boot/efi --bootloader-id=gentoo --recheck
#####You need to have emerged grub with the option
#### GRUB_PLATFORMS="efi-64" in make.conf
grub-mkconfig -o /boot/grub/grub.cfg
Code: Select all
GRUB_DISABLE_OS_PROBER="false"
Use refind. It only requires you to provide command line options in its config file (unless you want to create kernel-specific entries in which case using more edvanced configuration would make the resulting menu easier to navigate)alright, just shoot me... I boot from M2 NVME, UEFI seems to be working fine, ubuntu boots fine.
Yes, because mkconfig is not aware of an alternative root you can boot into.The Ubuntu Grub menu entry points to my 5.10.6 kernel, but the kernel boots and runs the ubuntu root. The UUIDs all point to the Ubuntu partition.
efibootmgr needs a mounted (and writeable) efivarfs. You can check with "mount" and "ls /sys/firmware/efi" (must exist).whitt wrote:[...] however the chrooted gentoo barfed an EFI related error when I ran efibootmgr. [...]
No, current CD boots fine with UEFI.whitt wrote:When you say "old gentoo installation cd" do you mean the current / latest image? [...]
This should be caused from an older kernel used there. When I did my last gentoo installation I had the same problem with a very new ethernet chip and I had to use the rescue-CD with a newer kernel.whitt wrote:Because I ran into a load of problems with that, not just my networking not working, [...]
This is always dangerous ...whitt wrote:[...] but being unable to make a bootable system after copying everything over to the image from another machine. [...]
You can check with "mount" if it is mounted "rw" or "ro". If "rw" and you have problems with efibootmgr, then you probably used wrong agruments. Just give us the exact command and the error message of it.whitt wrote:As far as efivars - I'm in the Gentoo chroot now, and I see /sys/firmware/efi/efivars now, [...]
Code: Select all
grub-install --target=x86-64_efi --boot-directory=/boot/efi --bootloader-id=gentoo --recheckCode: Select all
grub-install: error: /usr/lib/grub/x86-64_efi/modinfo.sh doesn't exist. Please specify --target or --directory.just a typo ...whitt wrote:Code: Select all
grub-install --target=x86-64_efi --boot-directory=/boot/efi --bootloader-id=gentoo --recheck
Yes, you should mount your ESP to /boot ... beforewhitt wrote:one question - I'm pointing to /boot/efi in the arguments to grub-install, but I haven't mounted the EFI partition at /boot/efi... Should I? I see "efivars /sys/firmware/efi/efivars type efivars (rw,nosuid,nodev,noexec,relatime)" when I `mount|grep efi` for whatever that's worth. I don't see how that relates to the missing file though...
Code: Select all
echeck
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.Did you mount it to your /boot or did you a mkdir /boot/efi and mounted it to /boot/efi ?whitt wrote:??
Code: Select all
(chroot) mrblack /usr/src/linux # umount /boot
(chroot) mrblack /usr/src/linux # mount /dev/sda1 /boot
(chroot) mrblack /usr/src/linux # grub-install --target=x86_64-efi --boot-directory=/boot/efi --bootloader-id=gentoo --recheck
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
(chroot) mrblack /usr/src/linux # ls /boot
EFI grubCode: Select all
(chroot) mrblack /usr/src/linux # mount |grep efi
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
(chroot) mrblack /usr/src/linux # mount |grep boot
/dev/sda1 on /boot type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)Dont believe every howto ...whitt wrote:No way - there are howtos out there telling me to mount it to /boot/efi...
Code: Select all
grub-install --target=x86_64-efi --efi-directory=/boot --removableCode: Select all
Installation finished. No error reportedFor now you should mount /dev/sda1 to your /boot and run grub-mkconfig IF your kernel is also therewhitt wrote:[...] If anyone has an opinion as to what should be mounted at /boot when I run grub-mkconfig, let me know... maybe you'll prevent me having a bad evening
Great to hear that.whitt wrote:OH what sweet, sweet success!
Did you read only the amd64 handbook or also the wiki entries ?whitt wrote:[...] The jumping from partitions and options in the handbook is handled very poorly...
I'm currently in the aftermath of changing my laptop to use EFI booting direct to my kernel built with the EFI stub loader support, so I feel your pain.whitt wrote:...First, that whole EFI bootloader config process is whack. It isn't very well documented...

That's because, in that case, specifying the --efi-directory option to grub-install is not needed. It's the place where grub-install looks for a mounted FAT filesystem by default (and will assume it's the ESP if it finds one).whitt wrote:No way - there are howtos out there telling me to mount it to /boot/efi...
If "your partition" means the ESP, it might be a consequence of GNU Parted's set boot command doing different things for a MS-DOS partition table and a GPT (it is a synonym of set esp for the latter).Goverp wrote:E.g. people saying "you need the boot flag on your partition".