I've prepared an WinPE USB flash disk. The content is the same as the ISO.
Renamed \EFI\boot\bootx64.efi (WinPE) to \EFI\boot\bootx64_winpe.efi
Then I've copied the grub2's files to the flash drive (including \EFI\boot\bootx64.efi from GRUB2).
Grub2 is loaded and it's shown grub's menu. Using the following entries WinPE was correctly loaded from the USB Flash drive :
menuentry "WinPE USB" {\r\n terminal_output console\r\n insmod chain\r\n chainloader (hd0,msdos1)/EFI/Boot/bootx64_winpe.efi\r\n}
After that, I've copied the WinPE ISO to the USB flash drive and added a menu entry:
menuentry "WinPE ISO" {\r\n terminal_output console\r\n set iso=/winpe.iso\r\n loopback loop ${iso}\r\n insmod chain\r\n chainloader (loop)/EFI/Boot/bootx64.efi\r\n}
WinPe starts to boot but there is an error code 0xc0000428 (The digital signature for this file couldn’t be verified).
Now it's happening something...
when I've tested before, I was using grub's console and this is my first time working with grub. so I didn't noticed that after "chainloader (loop)/EFI/Boot/bootx64.efi" it's necessary to use the boot command...
now using the menu or the console, I'm getting the same result (error) which is not good but is better than before.
Thanks,