[ipxe-devel] iPXE looping when gPXE does not

Michael Brown mbrown at fensystems.co.uk
Wed Jan 26 09:22:06 UTC 2011


On Wednesday 26 Jan 2011 07:08:21 James A. Peltier wrote:
> I'm trying to move from gPXE to iPXE and I seem to be having difficulty. 
>  In gPXE the following script works and does not get into a constant loop,
>  however, with iPXE it goes into a never ending loop.  Am I missing
>  something here??
> 
> #!ipxe
> 
> echo "Hi There!  We will be booting from http://mirror.its.sfu.ca/ today."
> echo "It is assumed that you have dhcp networking."
> 
> autoboot

Are you sure you want "autoboot" in here?  The script should never continue 
beyond this point, in either gPXE or iPXE, since autoboot will either fail or 
never return.

I assume you're trying to acquire an address via DHCP, in which case maybe 
something like:

#!ipxe
echo "Hi There!  We will be booting from http://mirror.its.sfu.ca/ today."
echo "It is assumed that you have dhcp networking."
dhcp
set 209:string pxelinux.cfg/default
set 210:string http://mirror.its.sfu.ca/tftpboot/
echo "Here we go!"
chain http://mirror.its.sfu.ca/tftpboot/pxelinux.0

might work for you?

Also, with iPXE you could look into making the script more robust by handling 
DHCP errors etc.  For example:

#!ipxe
echo "Hi There!  We will be booting from http://mirror.its.sfu.ca/ today."
echo "It is assumed that you have dhcp networking."
:retry
dhcp || goto retry
set 209:string pxelinux.cfg/default
set 210:string http://mirror.its.sfu.ca/tftpboot/
echo "Here we go!"
chain http://mirror.its.sfu.ca/tftpboot/pxelinux.0 || goto retry

which would cause both DHCP and the HTTP download to be retried indefinitely if 
e.g. the server were to be temporarily offline.

Michael



More information about the ipxe-devel mailing list