Despite @Sheluser's obvious trolling attempts I feel like I should share my new knowledge.
You can use the following workaround (e.g. from the post-install prompt) to install FreeBSD's UEFI OS loader into an existing EFI System Partition (ESP). The idea is to extract FreeBSD's loader from the filesystem image that is used when installing to a new ESP (which we do not want).
Mount FreeBSD's ESP image:
mount -o loop /boot/boot1.efifat /mnt
Let's assume the ESP resides in the third partition of the second ATA disk. Mount the preexisting ESP which shall receive the FreeBSD loader:
mkdir /efi
mount /dev/ada1p3 /efi
Or from linux:
mount /dev/sdb3 /efi
Extract FreeBSD loader from the image to the ESP:
cp -r /mnt/efi/boot/ /efi/EFI/freebsd
You may unmount /mnt and /efi now. Create a new Boot#### variable to register the new loader in EFI NVRAM:
efibootmgr -c -d /dev/ada1 -p 3 -l '\EFI\freebsd\BOOTx64.efi' -L FreeBSD
The last command should also show all boot variables, including the new one. Or you can just type
efibootmgr
Assuming that the new variable is named Boot0002, you may need to activate it first:
efibootmgr -a 0002
You may change the boot order like this:
efibootmgr -o 0002,0000,0001
Note that FreeBSD's ESP image contains a loader like this:
/efi/boot/BOOTx64.efi
But the /efi/boot/ directory specifies a fallback loader. EFI will only resort to the fallback loader if no other loader could be found. As there can only be one fallback loader, it is not wise to install FreeBSD's loader into /efi/boot. Windows for example installs both a fallback loader and a vendor loader, so the /efi/boot directory might be taken already. This is why we properly rename /efi/boot/ to a "vendor directory" according to the UEFI specification. I chose /efi/freebsd above but other names are fine, too. Also remember that FAT is case insensitive.
In my opinion, the above steps (or some equivalent) should just be done by the actual FreeBSD installer. For every existing partition, there should be something like two checkmarks: Use partition, Erase partition. This is how e.g. Debian lets the user choose to create a new ESP or to install to an existing one. The user should have this choice.
Regarding GRUB, the official packages and ports are obviously broken at the moment. I tried every possible combination, it just does not work. The ports do not build and none of the packages contain any of the necessary utilities such as
grub-mkconfig
,
grub-install
etc. See my previous posts above for details.
kpa suggested installing ports directly from SVN, but I really don't feel like it. How would those be more usable than the ones that are shipped officially? If the default ports and packages weren't fine, why do they even exist and how do they differ? I also do not understand why so many people seem to take on the burden of building ports for themselves when the official packages are just built from ports with default configuration. But don't bother answering those questions. I guess I could learn more about that matter on my own but I already wasted enough time to conclude that I won't bother for the moment.