Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handling DHCP timeouts in script
2012-11-24, 20:32
Post: #12
RE: Handling DHCP timeouts in script
It works for me... I do something a little less "aggressive" in my undionly script... I have to slow things down a bit to avoid possible issues with ports getting shutdown for too many broadcasts on an interface (an issue with highly subscribed virtualization farms).

Code:
#!ipxe
#Embedded Boot Script for undionly.kpxe
#Zero Stratum Script; all "Script Local" Variables should be prefaced with a "0_"

cpuid --ext 29 && set arch x86_64 || set arch i386
cpuid 6 && set pae 1 || set pae 0
cpuid --ecx 5 && set vmx 1 || set vmx 0
cpuid --ext --ecx 2 && set svm 1 || set svm 0

set network-mode undi

set 0_attempt 1
echo
echo Welcome to iPXE!
echo
echo iPXE is running in UNDI Mode...
echo
goto 0_startme

:0_retry0
set 0_attempt 2
sleep 3
goto 0_startme

:0_retry1
set 0_attempt 3
sleep 3
goto 0_startme

:0_retry2
echo No Boot Filename received; Exiting iPXE.
sleep 3
exit

:0_startme
dhcp && isset ${filename} || goto 0_retry_loop
goto 0_sys_info

:0_retry_loop
#Three (3) re-tries of the 0_startme Function.
iseq ${0_attempt} 1 && goto 0_retry0 ||
iseq ${0_attempt} 2 && goto 0_retry1 ||
iseq ${0_attempt} 3 && goto 0_retry2 ||

:0_sys_info
echo
echo iPXE System Summary:
echo Processor Architecture: ${arch}
echo PAE Supported ${pae}
iseq ${vmx} 1 && echo VTx Supported ${vmx} ||
iseq ${svm} 1 && echo AMD-v Supported ${svm} ||
echo Model: ${product}
echo UUID: ${uuid}
echo Serial Number: ${serial}
echo MAC Address of Active Interface: ${net0/mac}
echo Root Path: ${17}
echo Boot File Name: ${filename}
echo
sleep 5

chain ${17}/NetBoot/iPXE/default/check-hw.ipxe && goto 0_end ||

:0_end
echo
echo Thank You for using iPXE!
sleep 3
exit

"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 


Messages In This Thread
RE: Handling DHCP timeouts in script - MultimediaMan - 2012-11-24 20:32



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