UEFI Network Boot: loop and exec format error
|
2016-01-06, 22:01
Post: #1
|
|||
|
|||
UEFI Network Boot: loop and exec format error
Is there a resource I am overlooking for compiling and setting up a UEFI network boot through PXE? Otherwise, I am not sure what I am doing wrong. Any ideas?
Compiling myself: When attempting to compile iPXE I don't get any errors, but when booting to the ipxe.efi file on the client I get a loop where it tries to download the file, succeeds and then tries to download again. There does not seem to be an error message or I am missing it. Compiled master from last change (Wed, 6 Jan 2016 12:55:08 -0600 (18:55 +0000)). Changing the config in config/general.h does not seem to make a difference, although, I have tried with changes and without. I may be missing something there. Precompiled: ipxe.efi downloaded from the bottom of the page here: http://ipxe.org/howto/chainloading When I ctrl-b and run chain ipxe/menu.ipxe, then select CentOS 6.5 I get "Could not select: Exec format error (http://ipxe.org/2e008081)." Searching for the error I did not find anything. I tried this with a test CentOS menu item with http:// and nfs://. Hardware: HP DL60 Gen9 HP Ethernet 1Gb 2-port 361i Adapter (up to date firmware as of 11/2015) menu.ipxe: Code: #!ipxe dhcpd.conf: Code: # The ddns-updates-style parameter controls whether or not the server will |
|||
2016-01-06, 22:09
(This post was last modified: 2016-01-06 22:38 by NiKiZe.)
Post: #2
|
|||
|
|||
RE: UEFI Network Boot: loop and exec format error
(2016-01-06 22:01)altsysrq Wrote: Is there a resource I am overlooking for compiling and setting up a UEFI network boot through PXE? Otherwise, I am not sure what I am doing wrong. Any ideas? The boot loop sounds like the one described at http://ipxe.org/howto/chainloading#break...inite_loop How does the precompiled ipxe.efi behave differently from the one you compiled yourself? Efi environment only supports booting efi executables. To boot a Linux kernel in EFI mode it needs to be compiled with EFI_STUB enabled. A recent thread with this issue on CentOS 6.5: http://forum.ipxe.org/showthread.php?tid=7726 Edit: Sorry, missed part of your dhcpd.conf you want something like this : Code: next-server 10.10.10.1; First we move out next-server since it is set to the same for all cases. Next we add an if at the top that runs if it is iPXE that starts, and in that case we send the path to the script instead of the ipxe executable itself. That way it will stop loop booting Use GitHub Discussions VRAM bin |
|||
2016-01-06, 23:34
Post: #3
|
|||
|
|||
RE: UEFI Network Boot: loop and exec format error
Thank you for the quick response.
I left out the command I used to compile. The bootloop should have been disrupted with my EMBED setting. But I could have done something wrong of course. I was unable to get a prompt to come up or a simple shell using either a prompt command, shell, or pause command inside the script.ipxe. It seems like it downloads the file and then errors, but if there are any errors it is too fast to see. Here is the compile command: make bin/undionly.kpxe EMBED=../../script.ipxe The precompiled gives me a ctrl-b option where I can manually dhcp and chain to my menu.ipxe file. This works, but I would like to automate this without any typing. Ideally, I would like to compile it myself as I am sure this will make things easier in the future as updates are applied to iPXE. |
|||
2016-01-06, 23:48
Post: #4
|
|||
|
|||
RE: UEFI Network Boot: loop and exec format error
(2016-01-06 23:34)altsysrq Wrote: make bin/undionly.kpxe EMBED=../../script.ipxe When you embed a script the ctrl+b prompt is disabled. Note that make command will create an legacy file, that won't work in efi mode. Do you see the iPXE version header printed on screen with this file at all? (or atleast "iPXE initialising devices...") To compile a 64bit ipxe.efi file use make bin-x86_64-efi/ipxe.efi EMBED=../../script.ipxe If you post contents of your embeded script we can check if there might be anything wrong there. There is also script debugging that can be enabled with a command like: make bin-x86_64-efi/ipxe.efi EMBED=../../script.ipxe DEBUG=script script in this case refers to that scripts is handled by the script.c source file. Use GitHub Discussions VRAM bin |
|||
2016-01-07, 08:40
(This post was last modified: 2016-01-07 09:22 by MultimediaMan.)
Post: #5
|
|||
|
|||
RE: UEFI Network Boot: loop and exec format error
iPXE is working for you...
The problem is CentOS 6 (As well as Scientific Linux 6 and RHEL6) do not have the "EFI_STUB" option compiled into their kernels... i.e. they are not valid EFI Binaries. You need to boot (on the ISO) EFI/BOOT/BOOTX64.efi You can use iPXE to do it... but it's hardly worth it. Another recent relevant thread: Here. "Thus far, you have been adrift within the sheltered harbor of my patience..." |
|||
2016-01-07, 17:43
(This post was last modified: 2016-01-07 17:45 by altsysrq.)
Post: #6
|
|||
|
|||
SOLVED: UEFI Network Boot: loop and exec format error
Thank you for the responses.
Here is one example of my script.ipxe: Code: #!ipxe As a test I have also tried simply: Code: #!ipxe Quote:The problem is CentOS 6 (As well as Scientific Linux 6 and RHEL6) do not have the "EFI_STUB" option compiled into their kernels... i.e. they are not valid EFI Binaries. It seems I have 2 issues here. Lets bypass the CentOS 6.5 issue in this thread. I will look at the other threads recommended to fix that and if I run into further issues I can create a new thread. Quote:Note that make command will create an legacy file, that won't work in efi mode. Do you see the iPXE version header printed on screen with this file at all? (or atleast "iPXE initialising I did not get any of that. Quote:There is also script debugging that can be enabled with a command like: No change with the ixpe.efi compile. I get as far as Downloading the NBP successfully but nothing else shows up. Quote:script in this case refers to that scripts is handled by the script.c source file.Thank you for the clarification. Quote:There is also script debugging that can be enabled with a command like: The above suggestions plus installing (for reference to others): Code: apt-get install binutils-dev lib32z1-dev libiberty-dev This is the kicker for me. I was not doing this. When I tried it it worked. Consider this thread solved. I have other issues, but I will need to research those and find out what I am doing wrong. |
|||
2016-01-07, 23:53
(This post was last modified: 2016-01-08 00:03 by MultimediaMan.)
Post: #7
|
|||
|
|||
initrd
Quote: You may have a syntax error; if you are invoking the initrd with vmlinuz you need to specify you are using initrd loaded into memory: UEFI is ~really~ picky about explicitly specifying the initrd in the vmlinuz arguments. PCBIOS would "figure it out", but in UEFI, it just craps out and panics the vmlinuz kernel when vmlinuz attempts to locate the initrd.img; vmlinuz doesn't have a network stack yet, so this is crucial. Amended code: Code: :centos65 "Thus far, you have been adrift within the sheltered harbor of my patience..." |
|||
2016-01-08, 01:39
Post: #8
|
|||
|
|||
RE: initrd
Quote:You may have a syntax error; if you are invoking the initrd with vmlinuz you need to specify you are using initrd loaded into memory: UEFI is ~really~ picky about explicitly specifying the initrd in the vmlinuz arguments. PCBIOS would "figure it out", but in UEFI, it just craps out and panics the vmlinuz kernel when vmlinuz attempts to locate the initrd.img; vmlinuz doesn't have a network stack yet, so this is crucial. Thank you for bringing that up. I struggled with that a little bit. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)