Consider, for example, the following sequence: # mount_msdosfs /dev/gpt/efisys /mnt # mkdir -p /mnt/efi/freebsd # cp /boot/loader.efi /mnt/efi/freebsd/loader.efi # efibootmgr -c -l /mnt/efi/freebsd/loader.efi -L FreeBSD efibootmgr: Cannot translate unix loader path '\mnt\efi\freebsd\loader.efi' to UEFI: No error: 0 If the ESP is mounted using a normal device path (e.g., /dev/ada0p1) then everything works fine.
Today, I faced the very same problem on 13-CURRENT, 13.0-CURRENT #43 r342551: Thu Dec 27 14:51:56 CET 2018 amd64. Mounting ESP via /dev/ada0p1 worked, while mounting via /dev/gpt/efiboot0 does not and did produce the error shown by the initiator of this PR.
ditto, on 12.2R and 13.0-CURRENT still obviously. It's worth noting that the boot var can be created successfully if the underlying msdosfs partition is provided in non-GPT mode: root@akai /# efibootmgr -c -l nda0p1:/efi/ipxe/netboot.xyz.efi -L iPXE BootCurrent: 0000 Timeout : 0 seconds BootOrder : 0001, 0000 Boot0001 iPXE +Boot0000* efiBoot root@akai /# mount -t msdosfs -p /dev/gpt/efiboot /efi msdosfs rw 0 0 root@akai /# efibootmgr -v BootCurrent: 0000 Timeout : 0 seconds BootOrder : 0001, 0000 Boot0001 iPXE HD(1,GPT,d16765b3-317d-11e7-ab92-00249b24614a,0x28,0x12c000)/File(\efi\ipxe\netboot.xyz.efi) nda0p1:/efi/ipxe/netboot.xyz.efi (null) +Boot0000* efiBoot PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,d7-ed-0f-00-03-0d-08-00)/HD(1,GPT,d16765b3-317d-11e7-ab92-00249b24614a,0x28,0x12c000)/File(\efi\boot\bootx64.efi) nda0p1:/efi/boot/bootx64.efi (null)
I'm sorry I've not had a chance to work on this. I'm getting back to UEFI work on FreeBSD though, so hope to fix it in the next few weeks.
The problem here is translating the upper layer GEOM constricts (which is what the GPT label stuff is) to the lower-layer providers. It should be possible to fix that matching code, but I lost patience trying to chase things down w/o hard coding too many things.
FreeBSD 13.0 x64 I have the same issue. Spent very much time. Thank you for workaround.
(In reply to Warner Losh from 2020 comment #4) Fixed?
I think it's still a bug.