Bug 235806 - [PATCH] loader.efi won't load from embedded memory disk
Summary: [PATCH] loader.efi won't load from embedded memory disk
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.0-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
Keywords: patch
Depends on:
Reported: 2019-02-17 14:24 UTC by Dave Rush
Modified: 2020-03-12 15:56 UTC (History)
1 user (show)

See Also:

fix loader.efi embedded md loading (1.29 KB, patch)
2019-02-17 14:24 UTC, Dave Rush
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Rush 2019-02-17 14:24:50 UTC
Created attachment 202095 [details]
fix loader.efi embedded md loading

It would be very helpful for me to bring back the embedded MD support.

The FreeBSD Foundation article mentions embedding a MD image in loader.efi. This article appears to be a couple years old and some time between then and now MD image embedding must have broke. I'm not so interested in secure boot, but it is important to me to be able to load a fully functional / self contained system via the UEFI firmware network boot or from a system partition. Chainloading a loader.efi that doesn't have an embedded MD and having that continue on and load kernel & other things piece-meal from NFS, TFTP, or UFS/ZFS filesystems is not going to work for me.

One problem is that the EFI loader's conf.c does not include the md_dev in its devsw[] pointer list if MD_IMAGE_SIZE is defined. The second problem is that the EFI loader's main.c doesn't try to probe the md device as "currdev". The actual image itself was being correctly included in loader.efi when MD_IMAGE_SIZE is defined before this patch.
Comment 1 Dave Rush 2019-04-01 23:10:43 UTC
Is anyone able to help me with review of the loader.efi patch I submitted?