Skip to contentSkip to conversation

Grub2 EFI: compatibility with wimboot

DISCUSSION [email protected] 3 participants 10 messages Jun 5, 2018 – Jun 24, 2018

lore
Share & tools
lore
#1 lore raw

Hi,

Quoted 8 lines · On Tue, Jun 05, 2018 at 08:25:53PM +0200, [email protected] wrote:

Hello,

I wanted to ask if it would be possible to make the compatibility with wimboot in Grub2 EFI? currently only legacy works.

http://ipxe.org/wimboot

that would be really nice.

We are happy to help but first of all we need more info about your legacy BIOS and UEFI usage. Could you send us your config files, error messages, etc.?

Daniel

#2 lore raw

Okay,
wimboot works in Grub2 Legacy for example:

# Successfully boots

menuentry "Windows 7" {
	set ISOpath="/img/windows_7.iso"
	loopback loop $ ISOpath
	linux16 /boot/wimboot/wimboot
	initrd16 \
		newc:bootmgr:(loop)/bootmgr \
		newc:bcd:(loop)/boot/bcd \
		newc:boot.sdi:(loop)/boot/boot.sdi \
		newc:boot.wim:(loop)/sources/boot.wim
}

Because I can not use linux16 in Grub2 EFI, I use only linux but this creates a blackscreen (with the chaining it does not work either).

I also asked the developers of wimboot they said grub2 could not load EFI binarys directly.
So I ask, is that the case?

P.S.
I found this maybe this helps:
https://superuser.com/questions/1093986/boot-with-wimboot-a-windows-x64-imag
e-on-uefi-32-bits

-----Ursprüngliche Nachricht-----
Von: Daniel Kiper <[email protected]>
Gesendet: Freitag, 15. Juni 2018 14:08
An: [email protected]
Cc: [email protected]
Betreff: Re: Grub2 EFI: compatibility with wimboot

Hi,

Quoted 8 lines · On Tue, Jun 05, 2018 at 08:25:53PM +0200, [email protected] wrote:

Hello,

I wanted to ask if it would be possible to make the compatibility with wimboot in Grub2 EFI? currently only legacy works.

http://ipxe.org/wimboot

that would be really nice.

We are happy to help but first of all we need more info about your legacy BIOS and UEFI usage. Could you send us your config files, error messages, etc.?

Daniel

#3 lore raw
Quoted 18 lines · On Fri, Jun 15, 2018 at 07:14:29PM +0200, [email protected] wrote:

Okay,
wimboot works in Grub2 Legacy for example:

# Successfully boots

menuentry "Windows 7" {
	set ISOpath="/img/windows_7.iso"
	loopback loop $ ISOpath
	linux16 /boot/wimboot/wimboot
	initrd16 \
		newc:bootmgr:(loop)/bootmgr \
		newc:bcd:(loop)/boot/bcd \
		newc:boot.sdi:(loop)/boot/boot.sdi \
		newc:boot.wim:(loop)/sources/boot.wim
}

Because I can not use linux16 in Grub2 EFI, I use only linux but this creates a blackscreen (with the chaining it does not work either).

Quoted 8 lines

I also asked the developers of wimboot they said grub2 could not load EFI binarys directly.
So I ask, is that the case?

P.S.
I found this maybe this helps:
https://superuser.com/questions/1093986/boot-with-wimboot-a-windows-x64-imag
e-on-uefi-32-bits

Wait, are you trying to run Windows UEFI x64 on UEFI x32 (to be precise ia32) platform? It seems to me that such configs are not supported. Additionally, paths above show that you are trying to use legacy BIOS stuff. It will not run on UEFI platforms. I think that you should use more or less something like that (+/- /amd64 part):
- /amd64/boot/boot.sdi,
- /amd64/efi/microsoft/boot/bcd,
- /amd64/efi/boot/bootx64.efi
- /amd64/winpe.wim.

So, more or less there is a chance that the issue is not related to GRUB2.

Daniel

#4 lore raw

No it is windows UEFI 64bit on a UEFI 64bit platform
it doesn't matter anyway because even if I try to boot only Wimboot EFI from Grub2 EFI without parameters I also get a blackscreen.

I mean:

menuentry "Windows 7" {
linux /boot/wimboot/wimboot
}

I can't get linux16 to work in EFI, can I?

-----Ursprüngliche Nachricht-----
Von: Daniel Kiper <[email protected]>
Gesendet: Mittwoch, 20. Juni 2018 12:42
An: [email protected]
Cc: 'Daniel Kiper' <[email protected]>; [email protected]
Betreff: Re: Grub2 EFI: compatibility with wimboot

Quoted 22 lines · On Fri, Jun 15, 2018 at 07:14:29PM +0200, [email protected] wrote:

Okay,
wimboot works in Grub2 Legacy for example:

# Successfully boots

menuentry "Windows 7" {
	set ISOpath="/img/windows_7.iso"
	loopback loop $ ISOpath
	linux16 /boot/wimboot/wimboot
	initrd16 \
		newc:bootmgr:(loop)/bootmgr \
		newc:bcd:(loop)/boot/bcd \
		newc:boot.sdi:(loop)/boot/boot.sdi \
		newc:boot.wim:(loop)/sources/boot.wim
}

Because I can not use linux16 in Grub2 EFI, I use only linux but this creates a blackscreen (with the chaining it does not work either).

I also asked the developers of wimboot they said grub2 could not load EFI binarys directly.
So I ask, is that the case?

Quoted 5 lines

P.S.
I found this maybe this helps:
https://superuser.com/questions/1093986/boot-with-wimboot-a-windows-x6
4-imag
e-on-uefi-32-bits

Wait, are you trying to run Windows UEFI x64 on UEFI x32 (to be precise ia32) platform? It seems to me that such configs are not supported. Additionally, paths above show that you are trying to use legacy BIOS stuff. It will not run on UEFI platforms. I think that you should use more or less something like that (+/- /amd64 part):
- /amd64/boot/boot.sdi,
- /amd64/efi/microsoft/boot/bcd,
- /amd64/efi/boot/bootx64.efi
- /amd64/winpe.wim.

So, more or less there is a chance that the issue is not related to GRUB2.

Daniel

#5 lore raw

Re.: Grub2 EFI: compatibility with wimboot

Have you tried with win 10? Win 7 has problems with real uefi (from win 8).

-------- Mensagem original --------
Assunto: AW: Grub2 EFI: compatibility with wimboot
De: [email protected]
Para: 'Daniel Kiper'
CC: [email protected]

No it is windows UEFI 64bit on a UEFI 64bit platform
it doesn't matter anyway because even if I try to boot only Wimboot EFI from Grub2 EFI without parameters I also get a blackscreen.

I mean:

menuentry "Windows 7" {
linux /boot/wimboot/wimboot
}

I can't get linux16 to work in EFI, can I?

-----Ursprüngliche Nachricht-----
Von: Daniel Kiper
Gesendet: Mittwoch, 20. Juni 2018 12:42
An: [email protected]
Cc: 'Daniel Kiper' ; [email protected]
Betreff: Re: Grub2 EFI: compatibility with wimboot

Quoted 22 lines · On Fri, Jun 15, 2018 at 07:14:29PM +0200, [email protected] wrote:

Okay,
wimboot works in Grub2 Legacy for example:

# Successfully boots
menuentry "Windows 7" {
set ISOpath="/img/windows_7.iso"
loopback loop $ ISOpath
linux16 /boot/wimboot/wimboot
initrd16 \
newc:bootmgr:(loop)/bootmgr \
newc:bcd:(loop)/boot/bcd \
newc:boot.sdi:(loop)/boot/boot.sdi \
newc:boot.wim:(loop)/sources/boot.wim
}

Because I can not use linux16 in Grub2 EFI, I use only linux but this creates a blackscreen (with the chaining it does not work either).

I also asked the developers of wimboot they said grub2 could not load EFI binarys directly.
So I ask, is that the case?

Quoted 5 lines

P.S.
I found this maybe this helps:
https://superuser.com/questions/1093986/boot-with-wimboot-a-windows-x6
4-imag
e-on-uefi-32-bits

Wait, are you trying to run Windows UEFI x64 on UEFI x32 (to be precise ia32) platform? It seems to me that such configs are not supported. Additionally, paths above show that you are trying to use legacy BIOS stuff. It will not run on UEFI platforms. I think that you should use more or less something like that (+/- /amd64 part):
- /amd64/boot/boot.sdi,
- /amd64/efi/microsoft/boot/bcd,
- /amd64/efi/boot/bootx64.efi
- /amd64/winpe.wim.

So, more or less there is a chance that the issue is not related to GRUB2.

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#6 lore raw
In reply to [email protected]
Quoted 1 line · On Wed, Jun 20, 2018 at 05:27:23PM +0200, [email protected] wrote:

No it is windows UEFI 64bit on a UEFI 64bit platform

Great!

Quoted 10 lines

it doesn't matter anyway because even if I try to boot only Wimboot EFI from Grub2 EFI without parameters I also get a blackscreen.

I mean:

menuentry "Windows 7" {
linux /boot/wimboot/wimboot
}

I can't get linux16 to work in EFI, can I?

As I can see this command is enabled on UEFI x64 platforms. However, there is a pretty good chance that it does not work and probably it should be disabled in the future on UEFI compatible platforms. Anyway, I have managed to boot Windows using wimboot with chainloader. It required some experiments and wimboot code reading.

First of all you have to have an EFI System Partition (ESP) on a disk (probably other FAT formated partitions will work too; however, I have not tested that). Then you have to copy wimboot, bcd, boot.sdi and boot.wim to the ESP root directory. Please use UEFI x64 binaries. After that boot GRUB and execute following commands from its command line:

set root=(hd0,1) # This have to be an ESP.
chainloader /wimboot rawbcd rawwim
boot

By the way, wimboot command line processing is very crude. It is sad that it does not accept paths to required files. I hope that it will be fixed at some point.

There is also another option. Copy follwing files to an ESP:
- /amd64/efi/boot/bootx64.efi -> ESP:/efi/microsoft/boot/bootx64.efi (do not use /amd64/bootmgr.efi; it is designated for ISO images; it will not work; additionally, destination does no matter in this case; directory and file name can be arbitrary one),
- /amd64/boot/boot.sdi -> ESP:/boot/boot.sdi
- /amd64/efi/microsoft/boot/bcd -> ESP:/efi/microsoft/boot/bcd
- /amd64/winpe.wim -> ESP:/sources/boot.wim

After that boot GRUB and execute follwing commands from its command line:

set root=(hd0,1) # This have to be an ESP.
chainloader /efi/microsoft/boot/bootx64.efi
boot

You are done! Have a fun!

WRT GRUB linux command. I think that there is a bug or lack of support in GRUB and/or wimboot for something. Probably this is small thing. Sadly I do not have time to investigate it further. If somebody would like to take a look at the issue and prepare the patches then I am happy to review them.

FYI, I have tested that with GRUB upstream.

By the way, I think that it is worth putting this doc at iPXE webpage and/or GRUB doc. Any volunteers?

Daniel

#7 lore raw

Hello,
the problem is that with this method you can only load a wim file. I have several windows ISOs that should boot separately. Of course it would be really nice if you could load wimboot EFI with parameters directly via grub2 EFI.

So with menutrys

P.S.
The combination of shim, grub2 EFI and wimboot EFI with the command:
chainloader /wimboot rawbcd rawwim
leads to an error: "Could not install security protocol: (0x2) Invalid Parameter".

Jame

-----Ursprüngliche Nachricht-----
Von: Daniel Kiper <[email protected]>
Gesendet: Donnerstag, 21. Juni 2018 16:39
An: [email protected]
Cc: 'Daniel Kiper' <[email protected]>; [email protected]
Betreff: Re: Grub2 EFI: compatibility with wimboot

Quoted 1 line · On Wed, Jun 20, 2018 at 05:27:23PM +0200, [email protected] wrote:

No it is windows UEFI 64bit on a UEFI 64bit platform

Great!

Quoted 11 lines

it doesn't matter anyway because even if I try to boot only Wimboot EFI from
Grub2 EFI without parameters I also get a blackscreen.

I mean:

menuentry "Windows 7" {
linux /boot/wimboot/wimboot
}

I can't get linux16 to work in EFI, can I?

As I can see this command is enabled on UEFI x64 platforms. However, there is a pretty good chance that it does not work and probably it should be disabled in the future on UEFI compatible platforms. Anyway, I have managed to boot Windows using wimboot with chainloader. It required some experiments and wimboot code reading.

First of all you have to have an EFI System Partition (ESP) on a disk (probably other FAT formated partitions will work too; however, I have not tested that). Then you have to copy wimboot, bcd, boot.sdi and boot.wim to the ESP root directory. Please use UEFI x64 binaries. After that boot GRUB and execute following commands from its command line:

set root=(hd0,1) # This have to be an ESP.
chainloader /wimboot rawbcd rawwim
boot

By the way, wimboot command line processing is very crude. It is sad that it does not accept paths to required files. I hope that it will be fixed at some point.

There is also another option. Copy follwing files to an ESP:
- /amd64/efi/boot/bootx64.efi -> ESP:/efi/microsoft/boot/bootx64.efi (do not use /amd64/bootmgr.efi; it is designated for ISO images; it will not work; additionally, destination does no matter in this case; directory and file name can be arbitrary one),
- /amd64/boot/boot.sdi -> ESP:/boot/boot.sdi
- /amd64/efi/microsoft/boot/bcd -> ESP:/efi/microsoft/boot/bcd
- /amd64/winpe.wim -> ESP:/sources/boot.wim

After that boot GRUB and execute follwing commands from its command line:

set root=(hd0,1) # This have to be an ESP.
chainloader /efi/microsoft/boot/bootx64.efi
boot

You are done! Have a fun!

WRT GRUB linux command. I think that there is a bug or lack of support in GRUB and/or wimboot for something. Probably this is small thing. Sadly I do not have time to investigate it further. If somebody would like to take a look at the issue and prepare the patches then I am happy to review them.

FYI, I have tested that with GRUB upstream.

By the way, I think that it is worth putting this doc at iPXE webpage and/or GRUB doc. Any volunteers?

Daniel

#8 lore raw
Quoted 7 lines · On Thu, Jun 21, 2018 at 06:34:41PM +0200, [email protected] wrote:

Hello,
the problem is that with this method you can only load a wim file. I have several windows ISOs that should boot separately. Of course it would be really nice if you could load wimboot EFI with parameters directly via grub2 EFI.

So with menutrys

So, I would suggest to take a look at GRUB2/wimboot code and try to fix it. It should not require a lot of work. As I said earlier I am happy to review the patches.

Quoted 5 lines

P.S.
The combination of shim, grub2 EFI and wimboot EFI with the command:
chainloader /wimboot rawbcd rawwim
leads to an error: "Could not install security protocol: (0x2) Invalid Parameter".

Do you use UEFI secure boot or something like that? Anyway, I would play with rawbcd and rawwim arguments too.

Daniel

#9 lore raw

-----Ursprüngliche Nachricht-----
Von: Daniel Kiper <[email protected]>
Gesendet: Samstag, 23. Juni 2018 20:17
An: [email protected]
Cc: 'Daniel Kiper' <[email protected]>; [email protected]
Betreff: Re: Grub2 EFI: compatibility with wimboot

Quoted 7 lines · On Thu, Jun 21, 2018 at 06:34:41PM +0200, [email protected] wrote:

Hello,
the problem is that with this method you can only load a wim file. I have several windows ISOs that should boot separately. Of course it would be really nice if you could load wimboot EFI with parameters directly via grub2 EFI.

So with menutrys

So, I would suggest to take a look at GRUB2/wimboot code and try to fix it. It should not require a lot of work. As I said earlier I am happy to review the patches.

Well, I hope someone here wants to do that. Because my experience in programming is not enough, I guess.

Jame