I know 2 ways to achieve this.
BOOTX64.EFI
Note: I assume we use standard x86 64 bit platform.
In EFI partition create folders EFI\boot
. Put there your EFI application and name it BOOTX64.EFI
. That's it. Normally you even don't need to add an entry to NVRAM via efibootmgr
because many vendors check existance of EFI\boot\BOOTX64.EFI
on all FAT32 partitions by default.
EFI shell
As @prl mentioned in the comment, it's possible to start an EFI application automatically from a startup.nsh
script if your boot manager goes to EFI Shell as the first option. I think the script can be simple as this:
my_program.efi
Put startup.nsh
in the root of EFI partition. One downside, you usually see the 5 second countdown.