Post by WolOr, seeing as grub is deprecated with EFI, learn how to boot using EFI.
Don't worry, I haven't really learned either :-) I just keep a Slack
live-CD handy ...
(I'm tired and it's bedtime, so I hope you'll overlook any boo-boos.)
You can save yourself loads of grub complication and rewriting of boot loaders
by using bootctl from systemd-utils. It will give you plenty of flexibility
too. (Don't ask me why a recent version decided to display boot entries in
reverse order. Beas me.)
$ tree -L 3 /boot
/boot
├── amd-uc.img
├── config-5.15.88-gentoo-rescue
├── config-5.15.94-gentoo
├── config-6.1.19-gentoo-rescue
├── config-6.2.10-gentoo
├── config-6.2.9-gentoo
├── EFI
│ ├── BOOT
│ │ └── BOOTX64.EFI
│ ├── Microsoft
│ │ ├── Boot
│ │ └── Recovery
│ └── systemd
│ └── systemd-bootx64.efi
├── loader
│ ├── entries
│ │ ├── 06-gentoo-rescue-5.15.88.conf
│ │ ├── 07-gentoo-rescue-5.15.88.nonet.conf
│ │ ├── 08-gentoo-rescue-6.1.19.conf
│ │ ├── 09-gentoo-rescue-5.1.19.nonet.conf
│ │ ├── 30-gentoo-6.2.10.conf
│ │ ├── 32-gentoo-6.2.10.nox.conf
│ │ ├── 34-gentoo-6.2.10.nonet.conf
│ │ ├── 40-gentoo-5.15.94.conf
│ │ ├── 42-gentoo-5.15.94.nox.conf
│ │ └── 44-gentoo-5.15.94.nonet.conf
│ ├── entries.srel
│ ├── loader.conf
│ └── random-seed
├── System.map-5.15.88-gentoo-rescue
├── System.map-5.15.94-gentoo
├── System.map-6.1.19-gentoo-rescue
├── System.map-6.2.10-gentoo
├── System.map-6.2.9-gentoo
├── vmlinuz-5.15.88-gentoo-rescue
├── vmlinuz-5.15.94-gentoo
├── vmlinuz-6.1.19-gentoo-rescue
├── vmlinuz-6.2.10-gentoo
└── vmlinuz-6.2.9-gentoo
9 directories, 31 files
The layout above gives me a menu of four images to boot: the main system and a
rescue system, each with an earlier version in case of need. The main system
has a no-network option and a no-X option as well as the standard system. The
rescue system of course doesn't have X.
$ cat /usr/local/bin/kmake
#!/bin/bash
[[ $(/bin/cat /proc/mounts | /bin/grep boot) ]] || /bin/mount /boot
cd /usr/src/linux
time (/usr/bin/make -j24 && /usr/bin/make modules_install && /usr/bin/make install &&\
/bin/rm -f /boot/*old && /bin/echo
) &&\
/bin/echo && /bin/echo "Rebuilding modules..." && /bin/echo &&\
/usr/bin/emerge @module-rebuild @x11-module-rebuild
/bin/echo && /bin/ls -lh --color=auto /boot
/bin/echo
...and that's how I build a new kernel: with kmake. Then I just have to munge
the /boot/loader/entries with an mmv command and a couple of seds, then
'bootctl update'. Simple enough even for me.
You may be able to see from all that why I abandoned grub years ago. Far too
bloated, restrictive and cumbersome.
By the way, I hardly ever have to use efibootmgr; the only common cause is
having to delete the odd spurious entry.