Discussion:
Grub2 EFI: compatibility with wimboot
j***@gmx.de
2018-06-05 18:25:53 UTC
Permalink
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.
Daniel Kiper
2018-06-15 12:07:37 UTC
Permalink
Hi,
Post by j***@gmx.de
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
j***@gmx.de
2018-06-15 17:14:29 UTC
Permalink
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 <***@net-space.pl>
Gesendet: Freitag, 15. Juni 2018 14:08
An: ***@gmx.de
Cc: grub-***@gnu.org
Betreff: Re: Grub2 EFI: compatibility with wimboot

Hi,
Post by j***@gmx.de
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
Daniel Kiper
2018-06-20 10:41:35 UTC
Permalink
Post by j***@gmx.de
Okay,
# 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.
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
j***@gmx.de
2018-06-20 15:27:23 UTC
Permalink
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 <***@net-space.pl>
Gesendet: Mittwoch, 20. Juni 2018 12:42
An: ***@gmx.de
Cc: 'Daniel Kiper' <***@net-space.pl>; grub-***@gnu.org
Betreff: Re: Grub2 EFI: compatibility with wimboot
Post by j***@gmx.de
Okay,
# 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.
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
f***@pcclinic.pt
2018-06-20 17:39:33 UTC
Permalink
_______________________________________________
Grub-devel mailing list
Grub-***@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
Daniel Kiper
2018-06-21 14:39:17 UTC
Permalink
Post by j***@gmx.de
No it is windows UEFI 64bit on a UEFI 64bit platform
Great!
Post by j***@gmx.de
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.
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
j***@gmx.de
2018-06-21 16:34:41 UTC
Permalink
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 <***@net-space.pl>
Gesendet: Donnerstag, 21. Juni 2018 16:39
An: ***@gmx.de
Cc: 'Daniel Kiper' <***@net-space.pl>; grub-***@gnu.org
Betreff: Re: Grub2 EFI: compatibility with wimboot
Post by j***@gmx.de
No it is windows UEFI 64bit on a UEFI 64bit platform
Great!
Post by j***@gmx.de
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.
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
Daniel Kiper
2018-06-23 18:16:32 UTC
Permalink
Post by j***@gmx.de
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.
Post by j***@gmx.de
P.S.
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
j***@gmx.de
2018-06-24 11:05:00 UTC
Permalink
-----Ursprüngliche Nachricht-----
Von: Daniel Kiper <***@net-space.pl>
Gesendet: Samstag, 23. Juni 2018 20:17
An: ***@gmx.de
Cc: 'Daniel Kiper' <***@net-space.pl>; grub-***@gnu.org
Betreff: Re: Grub2 EFI: compatibility with wimboot
Post by j***@gmx.de
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

Loading...