From 0c9a27219ae440240ca13bd68cff896a5f7033d8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 26 Mar 2019 16:57:17 +0100 Subject: ipxe template: Fixes, more status output --- data/ipxe-embed.template | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'data') 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} || -- cgit v1.2.3-55-g7522