[ipxe-devel] Handling errors in scripts

Matthew Helton mwhelton at gmail.com
Sun Nov 25 03:09:19 UTC 2012


[quote] 2)I didn't build iPXE with the script, I'm just trying to use
undionly.kpxe with the script: [/quote]

Right there is your problem, I think. The script is in a remote location,
it is not embedded in iPXE. So, when you "run" it via chainload, you are
running it from the server (read once), not the client. I am not sure how
to copy a script into memory for "re-use" (I would think
imgfetch/imgload/initrd).

As it is now, If any command fails, you lose the path to the script. If you
would have chosen a different configuration characteristic which was not
network dependent, this wouldn't have occurred.

Instead of chainloading the script, try:

[code]
initrd ${path-to-script}
boot
[code]

as described here: http://www.ipxe.org/cmd/imgfetch?redirect=1

Best,

Matt



On Sat, Nov 24, 2012 at 5:50 PM, Ty Christensen <tyc at mastermindpro.com>wrote:

> Shao,
>
> 1) Script on the forum post at the link I've included in this thread
> 2) I didn't build iPXE with the script, I'm just trying to use
> undionly.kpxe with the script
> 3) Don't know...not at a place to check at the moment, but I will when I
> return to the office
>
> -----Original Message-----
> From: Shao Miller [mailto:sha0.miller at gmail.com]
> Sent: Saturday, November 24, 2012 10:58 AM
> To: Ty Christensen
> Cc: ipxe-devel at lists.ipxe.org
> Subject: RE: [ipxe-devel] Handling errors in scripts
>
> Good day, Ty.
>
> 1. What script are you using?
>
> 2. How did you build iPXE with that script?
>
> 3. What version does the iPXE you built report itself to be?
>
> - Shao Miller
>
> -----Original Message-----
> From: ipxe-devel-bounces at lists.ipxe.org
> [mailto:ipxe-devel-bounces at lists.ipxe.org] On Behalf Of Ty Christensen
> Sent: Saturday, November 24, 2012 12:26
> To: Thomas Miletich
> Cc: ipxe-devel at lists.ipxe.org
> Subject: Re: [ipxe-devel] Handling errors in scripts
>
> Does anyone have any idea why such simple functions are broken?  It's easy
> to test...just shut down the DHCP server on your physical network segment
> and watch as a script that is supposed to retry the DHCP request...doesn't.
> It exits the script every time.
>
>
> -----Original Message-----
> From: ipxe-devel-bounces at lists.ipxe.org
> [mailto:ipxe-devel-bounces at lists.ipxe.org] On Behalf Of Ty Christensen
> Sent: Wednesday, November 14, 2012 4:38 PM
> To: Thomas Miletich
> Cc: ipxe-devel at lists.ipxe.org
> Subject: Re: [ipxe-devel] Handling errors in scripts
>
> Did a fresh git sync and compiled undionly.kpxe.  Tried it, but got the
> same results.
>
>
> -----Original Message-----
> From: ipxe-devel-bounces at lists.ipxe.org
> [mailto:ipxe-devel-bounces at lists.ipxe.org] On Behalf Of Ty Christensen
> Sent: Wednesday, November 14, 2012 3:25 PM
> To: Thomas Miletich
> Cc: ipxe-devel at lists.ipxe.org
> Subject: Re: [ipxe-devel] Handling errors in scripts
>
> I don't think so, at least it's not ancient.  I did a git checkout only a
> month ago.  I'll do a fresh download and see if that makes a difference,
> though.
>
>
> -----Original Message-----
> From: Thomas Miletich [mailto:thomas.miletich at gmail.com]
> Sent: Wednesday, November 14, 2012 3:19 PM
> To: Ty Christensen
> Cc: ipxe-devel at lists.ipxe.org
> Subject: Re: [ipxe-devel] Handling errors in scripts
>
> How recent is your iPXE version?
>
> Could it be ancient enough to simply not support the new scripting
> features yet? It's always a good idea to try the most recent version anyway.
>
> Thomas
>
> On Thu, Nov 15, 2012 at 12:11 AM, Ty Christensen <tyc at mastermindpro.com>
> wrote:
> > I posted on the forums about a problem with iPXE scripts and error
> handling, but Robin ultimately suggested I try here instead.  To see the
> forum post and problem details, go here:
> > http://forum.ipxe.org/showthread.php?tid=6764
> >
> > The gist of the problem is that simple error handling within iPXE
> > scripts
> isn't working for me.  I've tried examples from the website, which make
> sense to me, but errors in the DHCP or sanboot steps of my script do not
> invoke the goto's or other error handling.  iPXE exits entirely back to the
> BIOS.
> >
> > I can't tell why such simple procedures in the script are not being
> handled correctly.  Does anyone know how to troubleshoot this?
> >
>
> _______________________________________________
> ipxe-devel mailing list
> ipxe-devel at lists.ipxe.org
> https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel
>



-- 
There is never time enough to do it right, but there always seems to be
enough time to do it again.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20121124/6f443f85/attachment.htm>


More information about the ipxe-devel mailing list