the easiest is, boot into your qubes os installation medium, then choose rescue qubes os, wait until next step, choose proceed to shell, continue, then ```efibootmgr -v -c -u -L pastor -l (your efi files) -d (your boot drive) -p (which partition),
example :
efibootmgr -v -c -u -L pastor -l /EFI/qubes/grubx64.efi -d /dev/sdb -p 1
I don’t know where efi file is located in 4.0.4 but i think it’s in /EFI/qubes/xen.efi