[gPXE] There and back again. gPXE to HTTP to TFTP

Andrew Bobulsky rulerof at gmail.com
Sun Oct 31 15:11:28 EDT 2010


Hello Ben,

I think the behavior that you're experiencing is similar to what usually baffles people the first time they try to drop gPXE into into a PXELINUX environment.  Getting the protocols to be used when and where you want them without being extremely explicit in your scripts tends to be a bit of a configuration chore.

I think that what you're experiencing comes from your DHCP option 67, where I'm guessing you've specified an HTTP URI.  Because that's a URI that starts with HTTP, gPXE will assume that any "unspecified" filenames will begin with the prefix that's sitting on your option 67 string.  Conversely, when you perform the Ctrl-B and clear the filenames from the command line, it defaults back to TFTP behavior.

The only thing I can think of is to try taking your SMBIOS based CGI script and tossing the "clear filename" and/or "clear net0.dhcp/filename" directive[s] in it before the "chain pxegrub" command.  As long as gPXE still has your boot server specified from DHCP (option 66 I think... I could have server/filename reversed in my head ;D) in the absence of HTTP being specified anywhere in the URI you present to the "chain" command, gPXE should default back to TFTP....  though I might be wrong there, as I've never tried it!

Secondly, the other thing you could do is to try specifying TFTP on your chain command like so:

chain TFTP://${next-server}/pxegrub

That might work too.

Cheers,
Andrew Bobulsky


On Oct 31, 2010, at 6:40 AM, Ben Rockwood wrote:

> I'm trying to augment my existing PXE deployment with gPXE to allow for
> scripting via CGI, etc..
> 
> In the "usual" way (according to the docs) I TFTP gPXE, it autoboots and
> grabs a URL from DHCP, then the gpxe script tells it to chainload a
> different URL based on the SMBIOS serial (http://server/${serial}.gpxe).
> So up to the point of chainloading the second gpxe script everything is
> by the book.
> 
> My problem is that from the HTTP script I want to TFTP boot.  According
> to the docs and video talks, any path that doesn't contain "http://"
> should be interpreted as TFTP... but this isn't the case.  Instead,
> "chain pxegrub" acts as though I mistakenly left off the base URL and
> fills it in for me.  I've even tried "chain /pxegrub", etc, but no luck.
> 
> So here's the wierd part that confuses the hell out of me.  If I boot to
> gPXE, bail out to the CLI and then walk it though my steps manually it
> works.  That is, if I do the following I'm fine via CLI:
> 
> <control-b>
> ifopen net0
> dhcp net0
> clear net0.dhcp/filename
> clear filename
> chain pxegrub
> 
> Like I said, the above proceedure done manually works just great.  I can
> boot my old SYSLINUX and PXEGRUB images via TFTP just as I always have.
> But if I translate the above into gpxe scripts from HTTP it doesn't work.
> 
> I've tried all manner for clearing variables, imgfree, etc, etc, etc.
> No matter what I do, I can't TFTP from an HTTP boot script.
> 
> 
> Please oh please, can someone point me in the right direction?  I've
> spent hours going round and round, and I'm sure its gotta be something
> simple I'm missing.
> 
> benr.
> _______________________________________________
> gPXE mailing list
> gPXE at etherboot.org
> http://etherboot.org/mailman/listinfo/gpxe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://etherboot.org/pipermail/gpxe/attachments/20101031/2ec31f91/attachment.html 


More information about the gPXE mailing list