summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/ipxe-embed.template13
1 files changed, 10 insertions, 3 deletions
diff --git a/data/ipxe-embed.template b/data/ipxe-embed.template
index 16d63d7..2150ea6 100644
--- a/data/ipxe-embed.template
+++ b/data/ipxe-embed.template
@@ -17,11 +17,14 @@ set idx:int32 -1 ||
set retlbl:string next_open
:next_open
inc idx
-iseq 20 ${idx} && goto fail ||
+iseq 20 ${idx} && goto retry_sleep ||
+echo Now checking if net${idx} is open...
# No MAC -- done
-iseq ${net${idx}/mac} ${} && goto fail ||
+iseq ${net${idx}/mac} ${} && goto retry_sleep ||
+echo net${idx} has MACaddr ${net${idx}/mac}
# Has no IP -- ignore
iseq ${net${idx}/ip} ${} && goto cleaniface ||
+echo net${idx} has IPaddr ${net${idx}/ip}
ifopen net${idx} || goto cleaniface
# Success
set retlbl dochain
@@ -29,10 +32,12 @@ goto setvars
# Now try to chain to main script
:dochain
+echo Now chaining to main script
set self:string http://%ipaddress%/boot/ipxe?uuid=${uuid}&mac=${mac}&manuf=${manufacturer:uristring}&product=${product:uristring}&platform=${platform:uristring}&slx-extensions=${slxext}
chain -ar ${self} || goto fail
echo How the hell did I get here?
:fail
+echo Failed.
set retlbl retry_sleep
goto cleaniface
:retry_sleep
@@ -45,7 +50,8 @@ iseq 20 ${idx} && set idx:int32 -1 ||
set retlbl:string next_dhcp
:next_dhcp
inc idx
-iseq 20 ${idx} && goto fail ||
+iseq 20 ${idx} && goto retry_sleep ||
+echo Now trying dhcp on net${idx}
# No MAC -- done
iseq ${net${idx}/mac} ${} && goto next_dhcp ||
echo Trying net${idx} via DHCP
@@ -57,6 +63,7 @@ goto setvars
# Clear interface IP address and close it
# Jumps back to label stored in ${retlbl}
:cleaniface
+echo Cleaning Interface net${idx}
clear net${idx}/ip ||
clear net${idx}.dhcp/ip ||
ifclose net${idx} ||