/*
* Linux kernels built for any architecture are guaranteed to support the
* LoadFile2 based initrd loading protocol if the image version is >= 1.
*/
if (lh->pe_image_header.optional_header.major_image_version >= 1)
initrd_use_loadfile2 = true;
else
initrd_use_loadfile2 = false;
If GRUB detects that MajorImageVersion in the opt header is greater than or equal to 1, it will load initrd using the LoadFile2 protocol.
The device path of initrd is hard-coded, and the GUID is LINUX_EFI_INITRD_MEDIA_GUID.
GRUB 2.12-rc1 has added support for loading initrd using the LoadFile2 protocol on x86 platforms. http://git.savannah.gnu.org/cgit/grub.git/commit/?id=cfbfae1aef0694b416aa199291cfef7596cdfc20 With this change, wimboot can be loaded by GRUB (2.12-rc1+) under EFI.
http://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/loader/efi/linux.c
If GRUB detects that MajorImageVersion in the opt header is greater than or equal to 1, it will load initrd using the LoadFile2 protocol.
The device path of initrd is hard-coded, and the GUID is
LINUX_EFI_INITRD_MEDIA_GUID
.wimboot can read the cpio initrd using LoadFile2->LoadFile.