ipxe / wimboot

WIM bootloader
https://ipxe.org/wimboot
GNU General Public License v2.0
238 stars 42 forks source link

Does @bootmgr=/bootmgr.exe work under grub4dos? #20

Closed steve6375 closed 3 years ago

steve6375 commented 3 years ago

Some WinPE's do not contain bootmgr.exe (they have no \windows\boot\PXE folder). I tried using @bootmgr= but it seems to be ignored. I have tried several versions of wimboot.

initrd @startupe2b.bat=%st% @winpeshl.ini=/_ISO/e2b/grub/winpeshl.ini @bcd=(0xff)%pp%/boot/bcd @bootmgr=(0xff)/bootmgr.exe @boot.sdi=(0xff)%pp%/boot/boot.sdi @boot.wim=(0xff)%pp%/sources/boot.wim %redir%

This works OK if the wim file contains PXE\bootmgr.exe, but does not work with those boot.wim files that don't contain that file. The file \bootmgr and \bootmgr.exe are present in the ISO so @bootmgr=(0xff)/bootmgr.exe should work.

steve6375 commented 3 years ago

image

mcb30 commented 3 years ago

This works OK if the wim file contains PXE\bootmgr.exe, but does not work with those boot.wim files that don't contain that file. The file \bootmgr and \bootmgr.exe are present in the ISO so @BOOTMGR=(0xff)/bootmgr.exe should work.

I haven't ever tested with grub4dos, but I'm guessing that you'll need to use @bootmgr.exe=(0xff)/bootmgr.exe so that you pass in bootmgr.exe with the correct filename.

steve6375 commented 3 years ago

sorry - I tried @bootmgr.exe and it worked! So documentation is wrong???

mcb30 commented 3 years ago

sorry - I tried @bootmgr.exe and it worked!

Great! :slightly_smiling_face:

So documentation is wrong???

Which documentation are you referring to?

steve6375 commented 3 years ago

https://ipxe.org/wimboot#custom_boot_manager

mcb30 commented 3 years ago

https://ipxe.org/wimboot#custom_boot_manager

No, that documentation is correct.

You can pass in a copy of either bootmgr or bootmgr.exe. What you initially tried (with @bootmgr=(0xff)/bootmgr.exe) was to pass in a copy of bootmgr.exe but with the filename bootmgr - that was the problem in your setup.

steve6375 commented 3 years ago

yes, thanks, I see that now, but the documentation in that section refers to bootmgr.exe but then gives an example using bootmgr which confused me. :-( I also did try the \bootmgr file which was inside the ISO but this failed to be loaded by wimboot. It presumably was not the correct format.

mcb30 commented 3 years ago

yes, thanks, I see that now, but the documentation in that section refers to bootmgr.exe but then gives an example using bootmgr which confused me. :-(

I've updated the documentation to list bootmgr, bootmgr.exe, and bootmgfw.efi as examples of boot manager files - hopefully that avoids this particular confusion in future.

I also did try the \bootmgr file which was inside the ISO but this failed to be loaded by wimboot. It presumably was not the correct format.

That should work. What debug messages do you get when you try it? (You may need to temporarily omit winpeshl.ini and other files so that the debug messages fit on a single screen)

steve6375 commented 3 years ago

image

steve6375 commented 3 years ago

That was Atlas-OS ISO. If I use a standard MS Win10 ISO then it does boot, but only because it found PXE\bootmgr.exe image

mcb30 commented 3 years ago

That was Atlas-OS ISO. If I use a standard MS Win10 ISO then it does boot, but only because it found PXE\bootmgr.exe

Thank you: that is useful information! I have found the root cause - wimboot currently searches within bootmgr for a compressed embedded bootmgr.exe at 16-byte boundaries, but the version used in Windows 10 has the embedded bootmgr.exe at offset 0xa3538, which is not 16-byte aligned.

I have a fix ready to apply - could you let me know your preferred name and email address for the commit log?

steve6375 commented 3 years ago

great! steve6375 is OK (steve@easy2boot.com).

mcb30 commented 3 years ago

Fix pushed as https://github.com/ipxe/wimboot/commit/c4e023d42356be9aff9dd3da549df59ce13d3943 - could you build wimboot from this commit and check that it works with your bootmgr?

steve6375 commented 3 years ago

no, sorry. Can you supply binary?

mcb30 commented 3 years ago

no, sorry. Can you supply binary?

wimboot.zip

steve6375 commented 3 years ago

Thanks. I can confirm works on x64 Atlas-OS.iso and MS x64 Win10 ISO and WIn7 x64 ISO when specifying /bootmgr which is on the ISO. In each case bootmgr.exe is extracted from bootmgr successfully. :-)

mcb30 commented 3 years ago

Thanks for testing. I've created https://github.com/ipxe/wimboot/releases/tag/v2.7.3 including this fix and submitted it for Secure Boot signing.

mcb30 commented 3 years ago

@steve6375 Has now been signed for Secure Boot and is available as the latest release version

steve6375 commented 3 years ago

Thanks for letting me know.