Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
paranoid chainloading script for flimsy tftp
2011-12-23, 22:25 (This post was last modified: 2011-12-26 11:27 by robinsmidsrod.)
Post: #1
paranoid chainloading script for flimsy tftp
Are you chainloading undionly.kpxe and want a universal script to break the loop...

Code:
#!ipxe
:label_retry_dhcp
dhcp && goto label_check_loop
set countdhcp ${countdhcp}x
iseq ${countdhcp} xxx || goto label_retry_dhcp
reboot
:label_check_loop
iseq ${filename} undionly.kpxe || goto label_no_loop
set filename ${filename}.ipxe
:label_retry_chain
chain ${filename} ||
set countchain ${countchain}x
iseq ${countchain} xxx || goto label_retry_chain
reboot
:label_no_loop
autoboot ||
set countautoboot ${countautoboot}x
iseq ${countautoboot} xxx || goto label_no_loop
reboot
Find all posts by this user
Quote this message in a reply
2011-12-24, 19:14
Post: #2
RE: paranoid chainloading script for flimsy tftp
That's not a bad idea... it may be a better one to ask for some new functions within the iPXE shell: namely support for an incremental counter (n=n+1) and a method for character substitution ( i.e. replace ":" with "-" ).

More functional iPXE scripts could be constructed and be considerably shorter.

I've found it not too difficult to freeze iPXE when using the CLI and the command buffer (using the up and down keys); this makes me a little leery of creating truly infinite loops within iPXE. I would prefer to have the option to try an action for some repetitions and failing that, to reboot to try again in a fresh environment.

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
2011-12-26, 11:19
Post: #3
RE: paranoid chainloading script for flimsy tftp
You are right that the script language is very limited, i also found that building loops like:

#!ipxe
:retry_dhcp
dhcp || goto retry_dhcp
:retry_chain
chain http://myserver/boot.php || goto retry_chain

can result in freezing the machine when a action fails to many times. When doing so on a virtual machine the end result is some loop in code causing 100% cpu when the machine freezes. When you limit the retries and put a reboot in it i got rid of the freezes. ipxe and gpxe before that are funny products with a lot of potential to get rid of the old pxe stack. However i get the idea that the community is too small and there are not enough developers to make it more mature yet. MCB30 is doing a great job but there is only so much one man can do.... Let's hope he reads this and likes the idea of more functionality in the script language;-)
Find all posts by this user
Quote this message in a reply
2011-12-26, 17:20
Post: #4
RE: paranoid chainloading script for flimsy tftp
I don't get the impression the development pool is too small (it is small... but so is the syslinux developer pool): I know that our scripting gripes are minor problems too, and probably ones that may be dealt with in due time.

As far as gPXE and iPXE go, this is a fairly recent effort (~3 years). Syslinux goes back over 13 years, and did not have menus and other features for quite some time. . . I don't do any compiling-level work...yet. (Professionally, I an more of an integrator.) This may be the catalyst.

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
Post Reply 




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