localhost /boot # grub-install --target=x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi
Installing for x86_64-efi platform.
grub-install: error: /boot/efi doesn't look like an EFI partition.

In diesem Fall erst einmal die Partitionierung anzeigen lassen. Zum Beispiel über cfdisk

#cfdisk /dev/sdb
Bitte beachten: die Angabe von /dev/sdb kann sich natürlich unterscheiden. Die erste Platte heisst /dev/sda und die 3. Platte /dev/sdc usw.

Ist der Ordner für die Installation angelegt?

localhost / # cd /boot/efi/
localhost /boot/efi # ls
localhost /boot/efi # ls -all
total 8
drwxr-xr-x 2 root root 4096 Jan  1 11:16 .
drwxr-xr-x 4 root root 4096 Jan  1 11:16 ..
localhost /boot/efi # 

Es kommt nur ein Eingabepromt beim Start von Grub – eine grub.cfg erstellen

localhost /boot/efi # grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.80-gentoo-x86_64
Found initrd image: /boot/initramfs-5.15.80-gentoo-x86_64.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

localhost /boot/efi # grub-install --target=x86_64-efi
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.

Tipp von Manfred unter http://www.gentooforum.de/artikel/22643/nur-grub-eingabepromt.html :

Ich kann dir das ArchLinux-WIKI über UEFI-Installation empfehlen

https://wiki.archlinux.de/title/UEFI_Ins…ion#Secure_Boot

Dort kannst du lesen, daß bei UEFI-Boot die Partition nicht ext4 ist.
Wenn du diese Boot-Partition so einrichtes:
mkfs.fat -F 32 -n EFIBOOT /dev/sdaX
und diese Partition als /boot mountest,
kannst du bei grub-install folgendes eingeben:

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=gentoo_grub --recheck --debug

Dann folgt noch
grub-mkconfig -o /boot/grub/grub.cfg

Dann müsste dein System problemlos booten.

Gruß
Manfred