Re: CURRENT: EFI boot failure

From: Ed Maste <emaste_at_freebsd.org>
Date: Tue, 16 Sep 2014 19:19:32 -0400
On 16 September 2014 18:25, O. Hartmann <ohartman_at_zedat.fu-berlin.de> wrote:
>
> Besides, checking both boot1.efi and loader.efi with file() shows something like
> loader.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS
> Windows. So both are PECOFF format files?

That is correct.

>>
>> boot1.efifat is a FAT filesystem image that contains a copy of
>> boot1.efi as /EFI/BOOT/BOOTX64.EFI.  It exists so that the installer
>> can treat it as opaque bootcode, like other boot schemes.  It's
>> certainly possible to create a partition, use newfs_msdos to format
>> it, and copy in boot1.efi instead.
>
> All right, here you lost me ... sorry. The partition created by the installes with type
> "efi" is then the /EFI/ partition, which then contains a folder BOOT and in which the
> boot1.efi is located?
> As I understand, I can manually mount this partition as FAT and copy boot1.efi as
> BOOTX64.EFI into it? This knowledge could come in handy if something goes very bad.

Sorry, not quite; an ESP is a separate partition formatted with FAT.
The file system in that partition has EFI/ in the root directory,
BOOT/ under that, and BOOTX64.EFI in there.

We don't (yet) mount the ESP inside of FreeBSD by default.  At least
some Linuxes do mount the ESP at /boot/efi, so you end up with
/boot/efi/EFI/BOOT/BOOTX64.EFI.  We might start doing something
similar when fleshing out dual-boot configuration support.

boot1.efifat is a copy (image) of the ESP, as it exists on the disk.
You can see what's inside:

# mdconfig -a -f /boot/boot1.efifat
md0
# mount_msdosfs /dev/md0 /mnt
# ls -l /mnt/efi/boot/BOOTx64.efi
-rwxr-xr-x  1 root  wheel  65536 Apr 26 20:43 /mnt/efi/boot/BOOTx64.efi
# umount /mnt
# mdconfig -d -u 0
Received on Tue Sep 16 2014 - 21:19:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:52 UTC