I’m currently tracking down an ext4 grub boot problem. I can easily maintain multiple grub boot environments on the EFI and maintain the boot / selection order with efibootmgr -o, and if I want to designate the next boot, efibootmgr -n. Where I would have multiple conflicting EndeavourOS installs, I override the name of the one I want to keep, in this case with GRUB_DISTRIBUTOR=eos in /etc/default/grub, as this is easier than constantly updating testing installations. In the case of testing, I specify a tmp GRUB_DISTRIBUTOR, so I get a tmp EFI install / name.
# grub-install --module="ahci gzio" --compress=no --recheck -v > /tmp/ev 2>&1 && efibootmgr -o 0,1,2,3,4 -n 4 | grep 000[0-4] && grep mkim.*core /tmp/ev && grep GRUB_DISTRIBUTOR /etc/default/grub | tail -1 && find /boot/efi | grep grubx64 | xargs ls -ltr
BootNext: 0004
BootCurrent: 0003
BootOrder: 0000,0001,0002,0003,0004
Boot0000* sirpool HD(2,GPT,b533a913-5d1b-4345-a597-2f89085942de,0x800,0x200000)/File(\EFI\sirpool\grubx64.efi)
Boot0001* altRoot HD(2,GPT,b533a913-5d1b-4345-a597-2f89085942de,0x800,0x200000)/File(\EFI\altRoot\grubx64.efi)
Boot0002* endeavouros HD(2,GPT,b533a913-5d1b-4345-a597-2f89085942de,0x800,0x200000)/File(\EFI\endeavouros\grubx64.efi)
Boot0003* eos HD(2,GPT,b533a913-5d1b-4345-a597-2f89085942de,0x800,0x200000)/File(\EFI\eos\grubx64.efi)
Boot0004* tmp HD(2,GPT,b533a913-5d1b-4345-a597-2f89085942de,0x800,0x200000)/File(\EFI\tmp\grubx64.efi)
grub-install: info: grub-mkimage --directory '/usr/lib/grub/x86_64-efi' --prefix '(,gpt8)/grub' --output '/boot/grub/x86_64-efi/core.efi' --dtb '' --sbat '' --format 'x86_64-efi' --compression 'auto' 'ahci' 'gzio' 'ext2' 'part_gpt'
GRUB_DISTRIBUTOR=tmp
-rwxr-xr-x 1 root root 294912 Jun 18 16:04 /boot/efi/EFI/altRoot/grubx64.efi
-rwxr-xr-x 1 root root 217088 Jun 21 15:55 /boot/efi/EFI/sirpool/grubx64.efi
-rwxr-xr-x 1 root root 139264 Jul 27 23:38 /boot/efi/EFI/EndeavourOS/grubx64.efi
-rwxr-xr-x 1 root root 139264 Jul 28 22:05 /boot/efi/EFI/eos/grubx64.efi
-rwxr-xr-x 1 root root 212992 Jul 29 15:44 /boot/efi/EFI/tmp/grubx64.efi
I just run this line each time, and it maintains the efibootmgr settings I want as well as compiling and installing grub with the tmp label so I don’t break my existing grub EFI selections and lets me know current status.
I don’t expect you will need anything this complex, but GRUB_DISTRIBUTOR and efibootmgr -o/-n are useful things to have in your toolkit.