Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
chain load with EFI and file:/ URL
2018-01-12, 14:35
Post: #1
chain load with EFI and file:/ URL
I want to use iPXE as a replacement for grub2 on a multiboot system. The goal is to have the BIOS boot in to the ipxe.efi which will read its configuration from a web server. The web server gives it a config file to for instance boot /EFI/redhat/grubx64.efi.

I am stuck at the point where I chainload another efi file. In the iPXE shell I get this:

Code:
iPXE:> imgload file:/EFI/redhat/grubx64.efi
file:/EFI/redhat/grubx64.efi... ok
iPXE> imgstat
grubx64.efi : 1050064 bytes [EFI]
iPXE> boot
Could not boot: No such device (http://ipxe.org/2c048097)

Apparently it can load the file but booting into it fails. Searching for hints using the error code has not gotten me far.

Is this the correct way to boot an EFI file from disk? Is this supported at all?
Find all posts by this user
Quote this message in a reply
2018-01-12, 18:22
Post: #2
RE: chain load with EFI and file:/ URL
Visiting the error url, in this case http://ipxe.org/2c048097 should give you good information about what is going on.
In this case not much is provided, but going in to the sourcecode shows that it tries to get a handle from "EFIIMAGE %p could not identify SNP device"

this seems to be a bug, but a workaround would probably be to open the interface, such as by using dhcp or ifopen net0 (but this requires that some kind of network interface was initialized)

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2018-01-15, 08:55
Post: #3
RE: chain load with EFI and file:/ URL
(2018-01-12 18:22)NiKiZe Wrote:  this seems to be a bug, but a workaround would probably be to open the interface, such as by using dhcp or ifopen net0 (but this requires that some kind of network interface was initialized)

Running dhcp beforehand actually helped, it now boots into file:/etc/redhat/grubx64.efi but does not load grub.cfg. It seems to me that file:/ URIs are intended for loading things like iPXE scripts but are not completely implemented for chain loading.

It looks like the the environment is not set up correctly. If I try to load file:/etc/redhat/shim.efi, which is supposed to load grubx64.efi in the same directory, it fails:

Code:
dppath: shim.efi
path:    shim.efi
Failed to open grubx64.efi - Not Found
...

So again, is this supposed to actually work? Has anybody ever tried to chain load an EFI image from a local disk and succeeded?
Find all posts by this user
Quote this message in a reply
2018-01-15, 19:58
Post: #4
RE: chain load with EFI and file:/ URL
The file:// was intended to load files from disk,
Everything that iPXE loads gets put in it's virtual memory fs, so when grub or anything else loads that is what it has access to and it does not know that it was loaded from disk and what the relative path is to any of the files that was sitting next to it.

So no the way you are trying to use it is not what it was designed for.

You could try to imgfetch all other relevant files so that it ends up in the same virtual fs, but not sure that will work eighter...

However there is one hack that works, using wimboot,
What you do is that you imgfetch all files that you need to have available,
The bootable file that you want to boot needs to be named bootx64.efi localy which can be don with imgfetch -n bootx64.efi file://grubx64.efi
and finally you chain to wimboot and that should create a virtual VFAT fs (which can be read by grub), and then boots bootx64.efi which is your grub.

imgfetch is the same thing as initrd and -n is the shorthand option for --name which you can find in the documentation.

PS might be wrong about the name bootx64.efi, but wimboot will tell you if that's the case

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2018-01-16, 19:20
Post: #5
RE: chain load with EFI and file:/ URL
I had the same problem http://forum.ipxe.org/showthread.php?tid=10703, even if the file is correctly loaded in memory
Find all posts by this user
Quote this message in a reply
2018-01-16, 20:15
Post: #6
RE: chain load with EFI and file:/ URL
(2018-01-16 19:20)sherpya Wrote:  I had the same problem http://forum.ipxe.org/showthread.php?tid=10703, even if the file is correctly loaded in memory

sherpya your thread seems to be about booting wimboot from grub.
This thread is about issues with starting grub from iPXE when it is loaded via file:// (grub itself starts fine, but can't find the files it expects to)

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2018-01-20, 04:58 (This post was last modified: 2018-01-20 05:02 by sherpya.)
Post: #7
RE: chain load with EFI and file:/ URL
(2018-01-16 20:15)NiKiZe Wrote:  
(2018-01-16 19:20)sherpya Wrote:  I had the same problem http://forum.ipxe.org/showthread.php?tid=10703, even if the file is correctly loaded in memory

sherpya your thread seems to be about booting wimboot from grub.
This thread is about issues with starting grub from iPXE when it is loaded via file:// (grub itself starts fine, but can't find the files it expects to)

I chainload snponly.efi so it's more or less the same thing (file:// points to a filesystem), then when I try to load files using file:// protocol on the usb storage, files are correctly loaded, but ipxe gives no such device if I try a command that "executes" the image

By looking at the sources `last_opened_snpdev()` returns null
Find all posts by this user
Quote this message in a reply
2019-05-01, 12:36
Post: #8
RE: chain load with EFI and file:/ URL
try to add ifopen on top of the script, I've managed to make grub2 -> wimboot (chainload) work
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)