Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Sep 2014 19:19:32 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        "O. Hartmann" <ohartman@zedat.fu-berlin.de>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>, Nathan Whitehorn <nwhitehorn@freebsd.org>, Allan Jude <allanjude@freebsd.org>
Subject:   Re: CURRENT: EFI boot failure
Message-ID:  <CAPyFy2C03AxTnQ_zoKkXEfyGqAQ4q_FBSwdk47qCfOzPQTDp=w@mail.gmail.com>
In-Reply-To: <20140917002524.5852fe14.ohartman@zedat.fu-berlin.de>
References:  <20140916020541.03c18d04.ohartman@zedat.fu-berlin.de> <54178607.1060305@freebsd.org> <541786BE.6010105@freebsd.org> <20140916075121.29989a53.ohartman@zedat.fu-berlin.de> <5417E20D.8070607@freebsd.org> <20140916230348.189e80cd.ohartman@zedat.fu-berlin.de> <CAPyFy2AicKf-PWGDnq80Zmm8ukwTkURZm8RRUFxdfHK=Xd7XAQ@mail.gmail.com> <20140917002524.5852fe14.ohartman@zedat.fu-berlin.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 16 September 2014 18:25, O. Hartmann <ohartman@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2C03AxTnQ_zoKkXEfyGqAQ4q_FBSwdk47qCfOzPQTDp=w>