Code:
#!ipxe
#Embedded Boot Script for undionly.kpxe
set boot-mode undionly
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 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 DHCP Lease or 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 to get a DHCP Address.
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 Booting Interface: ${net0/mac}
echo Root Path: ${17}
echo Boot File Name: ${filename}
echo
sleep 5
echo
echo Attempting to load Native iPXE MicroKernel...
sleep 2
chain ${17}/ipxe.pxe || goto 0_end
:0_end
echo
echo Thank You for using iPXE!
sleep 3
exit
Code:
#!ipxe
echo
echo iPXE is running in Native Mode...
echo
dhcp
set boot-mode native
echo
echo Attempting Serial Number Boot Script...
sleep 2
chain ${17}/boot.php?sn=${serial}&uuid=${uuid}&arch=${arch}&product=${product}&vmx=${vmx}&svm=${svm} && goto 0_end || goto 0_outcome_0
:0_outcome_0
echo
echo PHP Boot Script Not Found... Attempting Default Boot Script...
sleep 2
chain ${17}/default.ipxe && goto 0_end || goto 0_outcome_1
:0_outcome_1
echo
echo No Boot Script Not Found... Embedded Boot Script Ending; exiting iPXE...
sleep 2
:0_end
echo
echo Thank You for using iPXE!
sleep 3
exit