I installed the UEFI shell on my ARM laptop since, due to some bug, rEFInd is unable to launch on it, and I needed something to quickly set up and modify the UEFI boot configuration.

Note: Latest version of startup.nsh available here.

@echo -off
###############################################################
# EFI shell Startup script for my ARM laptop (Galaxy book GO) #
###############################################################

#Make console fill the entire screen
mode 240 56

#Try to find a script named `my-startup.nsh` on FS*
for %i in fs0 fs1 fs2 fs3 fs4 fs5 fs6 fs7 fs8 fs9
  if exists %i:\my-startup.nsh then
    #If it exists, change FS and run it
    %i:
    goto CUSTOM_STARTUP
  endif
endfor

#If my-startup is not found, exit.
#This will chainload the next bootloader in line
echo "Did not find my-startup.nsh, booting OS."
stall 1000000
exit

:CUSTOM_STARTUP
my-startup.nsh

This way, putting a file named my-startup.nsh on any filesystem the UEFI shell can mount will be executed instead of booting the next entry on the list, in my case the Windows bootloader.

For example, dropping this my-startup.nsh on any removable UEFI partition will make the UEFI shell chainload that instead of the default option, without the need of configuring the UEFI boot order or the one time boot menu, which in the case of this laptop the boot menu is quite unreliable at detecting the drive and the UEFI boot order is reset every time you boot without an USB drive.

@echo -off
echo chainloading drive default EFI
#Go to the default EFI boot directory
cd EFI/BOOT
#Run the default (ARM) bootloader
BOOTAA64.EFI

BOOTAA64.EFI is the default bootloader for 64bit ARM. For x64 it would be BOOTX64.EFI and for x86 it would be BOOTIA32.EFI. (And for Itanic it would be BOOTIA64.EFI if you still have thoseā€¦)