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.
Is anyone able to help me with review of the loader.efi patch I submitted?