iPXE discussion forum

Full Version: booting ipxe from pxelinux
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
booting ipxe from pxelinux (V4.04) worked fine in both variants

LABEL IPXE_command
KERNEL IPXE.LKRN ipxe_command

INITRD IPXE_initrd_file.ipxe

booting pxelinux (V6.01) both variants terminate with an error (invalid argument)

is there a workaround? How can I boot ipxe.lkrn and supply parameters without engaging dhcp or embed them in ipxe.
I try to avoid embedding commands in ipxe.lkrn because of additional administration efforts.
How about using gpxecmd.c32? Or aren't you using ipxe in front of pxelinux?
I cannot believe that gpxecmd.c32 will solve my problem.
Maybe my description was to generic.

Up to syslinux 4.04 the following default. file worked fine.

DEFAULT menu.c32
KERNEL ipxe.krn dhcp && chain

I could boot ipxe and transfer the commandline in one statement. Embedding commands in ipxe via "make" was not necessary.

Since syslinux 6.01 I get an error: invaldi argument.

How can I boot ipxe.lkrn or ipxe.pxe and supply parameters without engaging dhcp or embed them in ipxe during building ipxe?
You're doing the right thing in that pxelinux config file. I think this might be an issue with syslinux 6.xx. You might find more help if you ask in their forums. If it works in 4.xx but not in 6.xx then I believe something must've changed on the pxelinux side.
Digging a little deeper I modified my default. file in pxelinux.cfg

KERNEL ipxe.lkrn xxx

The result is:
Loading ipxe.lkrn...
Booting kernel failed: Invalid Argument

This is independant of the parameter xxx (can also be nul)

Obviously this is a ipxe.lkrn booting problem.
I suppose SYSLINUX team will tell me "debug your code"

How to identify, if this is a bug in syslinux or in ipxe.lkrn?
(Maybe syslinux team changed their requirements for booting.)

Can someone of the developers of ipxe verify my experience?
I don't know if this will work, but you do have to add the APPEND line in order to add kernel arguments...

KERNEL ipxe.lkrn
APPEND dhcp && chain

Now, embedding code into iPXE is simplicity itself:

your script:

dhcp && chain

as boot.ipxe

Then when compiling iPXE:

make bin/undionly.kpxe EMBED=boot.ipxe

If you want to use the full driver kernel, it is too large to boot on it's own, so you chainload the ipxe.pxe file... undionly.kpxe with an embedded script to chainload ipxe.pxe, and then ipxe.pxe with an embedded script to chainload NFW.ipxe


make bin/undionly.kpxe EMBED=chain.ipxe
make bin/ipxe.pxe EMBED=boot.ipxe

your undionly script (chain.ipxe):

dhcp && chain

your ipxe.pxe script (boot.ipxe) :

dhcp && chain

make bin/undionly.kpxe EMBED=chain.ipxe
make bin/ipxe.pxe EMBED=boot.ipxe


Also, if you build ipxe.lkrn it is a bzImage Linux kernel image, which syslinux should be very capable of booting, regardless of version. Are you having issues booting any other type of linux kernel bzimages? Also, you can also use ipxe.pxe, as pxelinux should be able to load that format as well.
Replying to MultimediaMan:
Using APPEND does not solve the problem. (As ipxe.lkrn will not get booted at all, the append statement is not relevant.)
Embedding works fine, but is cumbersome to administrate. That's why I try to avoid it.

Replying to robinsmidsrod:
Other bzImage images work fine. Using ipxe.pxe requires embedding. See above.

There are indications that syslinux causes the problems.
Did anybody try to prove my test results? As there are no special preconditions it's quite easy to do so.
I was able to get it to work with syslinux 6.01 pxelinux.0 using the ldlinux.c32 helper binary. HPA changed quite bit in syslinux 6.01, and you should read all of the documentation. Not all of the old ways of doing things translate to this release.

Going back to Embedded Scripts... Realize that with a little thought you can do some amazing things with an embedded script which does something in a repeatable manner, which is then controlled server-side.


${17} = http://your.webserver.com

undionly.kpxe with the following embedded script:

chain ${17}/default.ipxe

You can then write default.ipxe as simple or as complicated as you like.

In default.ipxe you could then do something like:

chain ${17}/${uuid}

and so on.

The point being, iPXE beats the daylights out of what syslinux can do, and it doesn't have to be restricted to private networks to get a decent amount of security while doing it. Syslinux is and remains a powerful tool, but it's continued reliance on TFTP, lack of native DNS support as well as it's DOS-like *.c32 binaries are limiting it's potential as a viable network boot program in today's environments. Syslinux pxelinux.0 does seem to have better overall basic hardware compatibility, but the tradeoff with compatibility is flexibility.

I do use syslinux on those hardware types I know have issues with the larger undionly iPXE images (Realtek), but that's about the only place I use it anymore.


Quote:MultimediaMan wrote: HPA changed quite bit in syslinux 6.01, and you should read all of the documentation. Not all of the old ways of doing things translate to this release.

I had red the documentation and used pxechn.c32 all the time. It works fine. But I have no idea how to pass parameters when I chain ipxe.pxe.
So I have to use embedding...

My standard configuration is to boot pxelinux.0 and chain ipxe.pxe. Although this is not the fastest solution it is reliable and does not require any ROM burning or other modification.
Embedding dhcp and chain chain-main.ipxe I can take the best of both worlds.

By the way I started testing syslinux 6.01 because I red that syslinux 6.01 supports FTP. Later I recognized that also IPXE supports FTP. (To recognize this I had to read some .h files, as the build options in the web-doc do not show this option.)

In general I perfer to use either pxelinux or ipxe whichever suits best for my tasks. My concern was to avoid embedding, because this adds to the administration efforts. That's why I posted here.

In the meantime I have decreased my efforts by just embedding two statements in one program (ipxe.pxe, see above) Everything else I can do via scripts. So my problem is solved.

I assume that in one of the next releases of syslinux ipxe.lkrn will be bootable again.
I understand, and am totally in agreement that the documentation might need a little more polish.

Re: Passing arguments; I'm not sure what you want to do is possible, because in ipxe.pxe and ipxe.lkrn you still must hit "ctrl-b" to enter the CLI. So you might want to look up the ASCII command and read up on whether pxechn.c32 or ldlinux.c32 can pass ASCII character codes and try Appending that ASCII code to begin with.

As far as embedding, if you standardize your infrastructure, you will find yourself not touching the embedded scripts very often.

Functionally-Speaking, I have not substantially altered my embedded scripts. There were some major scripting changes done during mid-summer, and that caused me to re-write the embedded scripts to save space in the undionly.kpxe binary.

However, if you are a frequent compiler like me, you might want to think about scripting the build process itself. I created a short script which automated the make process. It creates a undionly.kpxe file, an ipxe.pxe file, and an ipxe.usb file (for Broken BIOS machines). When the make is complete it copies them to an archive folder and then copies the files to the TFTP and Web Servers. So the process from end-to-end, takes about 60 seconds.
I prefer to boot initially pxelinux.0. To boot ipxe I chain ipxe.pxe.
KERNEL pxechn.c32 /ipxe.pxe
This solution requires to embed an xxx.ipxe command file.
As I stated at the beginning of this posting with syslinux 4.04 it was possible to pass ipxe commands without embedding.
#default (my pxelinux.cfg/default file)
Kernel iPXE.LKRN
INITRD xxx.ipxe (this is the same .ipxe file I have to embed with syslinux 6.01)
There was no need to hit „Ctrl-B“ at any time.
I prefer not to use undionly.kpxe as this requires additional efforts but I do not see any advantage compared with booting pxelinux.0.
There is also no infinite loop I have to break. This solution also works fine with WDS.
I hope the solution available with syslinux 4.04 will be available with syslinux 6.02 again. (First tests with a pre-release look good.)

iPXE offers a lot of valuable features but some of them are well hidden, as descriptions in the documentation are missing.
I chain boot ipxe.krn from pxelinux 6.02 but encounter "invalid argument" error. Is there any solution so far?
(2013-10-18 23:24)ccy Wrote: [ -> ]I chain boot ipxe.krn from pxelinux 6.02 but encounter "invalid argument" error. Is there any solution so far?

For now, use Syslinux 4.04 or earlier binaries. HPA knows there is an issue, and they are working on a fix.

If you are running an environment where there are multiple versions of syslinux, remember that all search directories in syslinux are relative to 'pxelinux.0' passed as DHCP Option 67.

So if you have syslinux 3.86, 4.04, 5.01 and 6.02

Create a directory structure under tftpboot/syslinux with the version numbered directories: unfortunately symlinks are an iffy thing with syslinux (and TFTP Servers in general for that matter), so the pxelinux.cfg directory would also need to be copied into each directory structure. However, this isn't entirely a bad thing, because of all the attendant binaries: memdisk, menu.c32, etc... I place those files in a directory named "bin".






If you need a specific client to boot a specific version of syslinux, point them to the relative path desired:

The TFTP Root directory has undionly.kpxe and is the default passed to all clients.
option bootfile-name "undionly.kpxe";

A DHCP Reservation for a client is created that needs to use syslinux 4.04:

option bootfile-name "syslinux/4-04/pxelinux.0";


(2013-10-19 17:45)MultimediaMan Wrote: [ -> ]For now, use Syslinux 4.04 or earlier binaries. HPA knows there is an issue, and they are working on a fix.

Thanks for the information. I use syslinux 6.02 is because of new UEFI boot.

I prefer to use symbolic link to pxelinux.cfg to for various version of syslinux. I also turn on TFTP log to monitor the request files for debugging.

May I know what is HPA? So this is Syslinux problem and not ipxe problem?
I also want to use lpxelinux.0 but it doesn't exist in syslinux 4.04

(2013-10-19 17:45)MultimediaMan Wrote: [ -> ]For now, use Syslinux 4.04 or earlier binaries. HPA knows there is an issue, and they are working on a fix.
(2013-10-20 11:58)ccy Wrote: [ -> ]May I know what is HPA? So this is Syslinux problem and not ipxe problem?

HPA = Hans Peter Anvin, creator and maintainer of syslinux, and an all-around good guy.
I have tried Syslinux 4.07 and it can boot to ipxe.lkrn too.
I had the same issue as the OP with Syslinux 6.02. I've upgrade to 6.03-pre6 which seems to have resolved the issue in the OP.

But now, after selecting ipxe.krn (tried ipxe.lkrn as well) all I get on the screen is:
iPXE Initialising devices...

Then it just hangs. CTL-ALT-DEL won't even bring it back, must hit the power switch.

Any idea what's going on?

VirtualNobody: If things work with older pxelinux then maybe that pre-release version has some issue still. I'd contact the syslinux people and see if they can figure it out.
hi everyone,
i reply to this thread because i have a similar problem booting iPXE from pxelinux. I have no access to the dhcp (only to the tftp) and just want to use an existing dhcp group, which comes up with tftp. So i defined

KERNEL ipxe/ipxe.lkrn

I compiled ipxe.lkrn with an embedded script for loading a debirf kernel and image. But i don't want to repeat the dhcp request with "ifconf" or "dhcp" command (sometimes it works sometimes not, maybe because of a dhcp loop or whatever, wonder why this worked at all ;-)) With "IPAPPEND 1" in SYSLINUX i could get all the settings (ip, gateway...) from my first request to setting up my net0 manually. But how can i hand over a simple commandline string and post process it in my ipxe script? Or should i compile my own command? Something like

KERNEL ipxe/ipxe.lkrn custom=

any ideas how to get a custom string variable passed to ipxe script?
kind regards
Reference URL's