Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem chainloading syslinux.efi from iPXE
2016-04-28, 09:57
Post: #1
Problem chainloading syslinux.efi from iPXE
I have compiled iPXE from the Github repository and I'm trying to use it on a UEFI system to chainload into our SysLinux-based PXE system.

As it is, iPXE does not like the syslinux.efi it is grabbing:

[Image: IPXE_EFI2.png]
[Image: IPXE_EFI3.png]

I've blanked out our public IP address. The above is a VM, on a physical box it reboots before I can grab the output. The ultimate purpose of this is to have a UEFI bootable memory stick that can bypass DHCP and boot to a specific PXE server using a static IP number. For now it gets an IP from DHCP and then overrides the values.

Here is the embedded script content:

Code:
#!ipxe
echo Built by MGR on 28 April, 2016
set syslog xxx.xxx.xxx.12

# Default student PXE server
set next-server xxx.xxx.xxx.12

# Offer manual IP configuration
prompt --timeout 3000 Press a key to configure network manually, or wait for DHCP. || goto godhcp

# Manual IP configuration
echo In the configurator go into the 'net0' or 'net1' sub-menu and configure these
echo three fields for the VLAN this PC is connected to:
echo gateway
echo ip
echo netmask
prompt Press a key when ready to begin.
config
ifopen
echo The default route is configured as follows:
route
prompt --timeout 3000 Press a key to enter shell, or wait for PXE boot. || goto gopxe
shell
goto gopxe

# Get a DHCP address
echo Obtaining an IP number from DHCP...
:godhcp
dhcp || goto godhcp
echo DHCP has given IP number ${netX/ip} for MAC ${netX/mac}
echo Gateway IP: ${netX/gateway}
prompt --timeout 3000 Press a key to enter shell, or wait for PXE boot. || goto gopxe
shell

:gopxe
# Offer a Staff network option
prompt --timeout 3000 Press a key for Staff network PXE, or wait for Student network PXE. || goto gogopxe
set next-server xxx.xxx.xxx.13

:gogopxe
set netX/next-server ${next-server}

# EFI or BIOS?
iseq ${platform} efi && goto efi || goto bios

:bios
set filename pxelinux.0
goto gogogopxe

:efi
set filename syslinux.efi

:gogogopxe
set netX/filename ${filename}
echo PXE server is ${netX/next-server}
echo PXE boot file is ${netX/filename}

# Set SYSLINUX configfile
set 210 http://${next-server}/
set 209 pxelinux.cfg/default

# PXE boot
chain http://${next-server}/${filename}

I have tried various 64-bit versions of syslinux.efi, including 6.03 binaries provided on the website and compiling my own from the source. None of them work, so I suspect my iPXE build is not configured correctly.

In config/general.h I have set:

#define IMAGE_EFI

Are there any other configuration changes I need to make to get this working? Or additional debugging I can add to 'DEBUG=dhcp:2,tftp:2,http:2,image:7,efi_init:7,efi_image:7' that would provide useful output?

Thanks.
Find all posts by this user
Quote this message in a reply
2016-04-28, 12:21
Post: #2
RE: Problem chainloading syslinux.efi from iPXE
(2016-04-28 09:57)mattross Wrote:  I have tried various 64-bit versions of syslinux.efi, including 6.03 binaries provided on the website and compiling my own from the source. None of them work, so I suspect my iPXE build is not configured correctly.

Some minor side points first;

The "format not recognised" error is entirely misleading, and has now been fixed in http://git.ipxe.org/ipxe.git/commitdiff/b696a50.

You don't need to explicitly add IMAGE_EFI in config/general.h; it's already enabled by default for EFI builds (via config/defaults/efi.h).

Using ":2" as a debug level is generally incorrect, since the debug level is a bitmask. You probably want ":3" instead. See http://ipxe.org/download#debug_builds.

As for your actual problem:

You can try using DEBUG=efi_wrap to see what system calls are being issued by the loaded syslinux.efi. It's similar to running strace on a userspace binary.

One question I have is why are you trying to use iPXE to load syslinux.efi, instead of just using iPXE to load your OS directly? You're already creating a custom iPXE script, so why not just extend that script to boot your OS? That would definitely simplify your setup, which is always a good thing.

Michael
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-04-28, 12:47
Post: #3
RE: Problem chainloading syslinux.efi from iPXE
Thanks for the tips, have updated accordingly and rebuilt. This is not for booting an OS, we use our PXE for Clonezilla, utility ISOs and various other things. It's all working via BIOS, and now I would like to get it working via EFI before our PC supplier removes BIOS from the firmware altogether.

Here is the final output before it crashes:

[Image: IPXE_EFI4.png]
Find all posts by this user
Quote this message in a reply
2017-01-19, 18:36
Post: #4
RE: Problem chainloading syslinux.efi from iPXE
(2016-04-28 12:47)mattross Wrote:  Thanks for the tips, have updated accordingly and rebuilt. This is not for booting an OS, we use our PXE for Clonezilla, utility ISOs and various other things. It's all working via BIOS, and now I would like to get it working via EFI before our PC supplier removes BIOS from the firmware altogether.

Here is the final output before it crashes:

[Image: IPXE_EFI4.png]

Did you get this working?
Find all posts by this user
Quote this message in a reply
2019-01-10, 21:15 (This post was last modified: 2019-01-10 21:53 by rahuls551.)
Post: #5
RE: Problem chainloading syslinux.efi from iPXE
I am running into the same problem? Is there a solution to this?

I was running the system in legacy mode but when i switched to uefi mode then the system is giving me another error core_udp_sendto: stalling with no mapping.

Any help appreciated.
Find all posts by this user
Quote this message in a reply
2019-01-10, 22:03
Post: #6
RE: Problem chainloading syslinux.efi from iPXE
I will repeat this question.
(2016-04-28 12:21)mcb30 Wrote:  One question I have is why are you trying to use iPXE to load syslinux.efi, instead of just using iPXE to load your OS directly? You're already creating a custom iPXE script, so why not just extend that script to boot your OS? That would definitely simplify your setup, which is always a good thing.

If the answer is "I already have a syslinux menu", then:
1. Just rewrite it in iPXE script - you will thank yourself later (many years back I did, and today I'm really happy that I didn't try to stay in syslinux)
2. If syslinux is working, why are you trying to use iPXE?

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2019-01-11, 18:46
Post: #7
RE: Problem chainloading syslinux.efi from iPXE
(2019-01-10 22:03)NiKiZe Wrote:  I will repeat this question.
(2016-04-28 12:21)mcb30 Wrote:  One question I have is why are you trying to use iPXE to load syslinux.efi, instead of just using iPXE to load your OS directly? You're already creating a custom iPXE script, so why not just extend that script to boot your OS? That would definitely simplify your setup, which is always a good thing.

If the answer is "I already have a syslinux menu", then:
1. Just rewrite it in iPXE script - you will thank yourself later (many years back I did, and today I'm really happy that I didn't try to stay in syslinux)
2. If syslinux is working, why are you trying to use iPXE?

The reason is I am testing chain loading with ipxe. When I load syslinux through ipxe and try to boot I am getting this error


CloseProtocol (UKNOWN<0x64582c18, Udp4>, Udp4Sb......syslinux.efi, UNKNOWN = INVALID_PARAMETER.

This error keeps on repeating. Any ideas>
Find all posts by this user
Quote this message in a reply
Post Reply 




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