From 17759278184463f84e2dfdbaa93882d0d3dd5423 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 28 Aug 2018 17:35:51 +0000 Subject: [registration/dhcp] Implement dhcp as external-backend Registration -> Registrations to match API guidelines. Fixed shell script to only build undionly.kpxe. Added infoblock external-backend. Removed dhcp from config.json Fixed ipxe scripts to match the registrations. --- server/ipxe/default.ipxe | 64 ++++++++++++++++++++++++++++++++++++++++ server/ipxe/exitTestScript.ipxe | 57 ----------------------------------- server/ipxe/ipxe.0 | Bin 0 -> 90057 bytes server/ipxe/main.ipxe | 30 +++---------------- server/ipxe/registration.ipxe | 34 +++++++++++++-------- 5 files changed, 89 insertions(+), 96 deletions(-) create mode 100644 server/ipxe/default.ipxe delete mode 100644 server/ipxe/exitTestScript.ipxe create mode 100644 server/ipxe/ipxe.0 (limited to 'server/ipxe') diff --git a/server/ipxe/default.ipxe b/server/ipxe/default.ipxe new file mode 100644 index 0000000..e070ca6 --- /dev/null +++ b/server/ipxe/default.ipxe @@ -0,0 +1,64 @@ +#!ipxe + +# Wallpaper +set img tftp://10.8.102.124/ipxeWallpaper3_scale.png || shell +console --picture ${img} --x 800 --y 600 || shell + +:start +menu Please choose a webserver to load the ipxe menu: +item bwlehrpool bwLehrpool +item reg Registration +item pxelnx PxeLinux +item c32boot C32Boot +item exit Exit +item exit0 Exit0 +item exit1 Exit1 +item sh [Shell] +choose target && goto ${target} + +:bwlehrpool +chain --replace http://132.230.4.2/tftp/ipxelinux.0 + +:reg +set crosscert http://ca.ipxe.org/auto/ +chain --replace https://bas.stfu-kthx.net:8888/api/ipxe/load/registration || +goto start + +:exit +exit || +goto start + +:exit0 +exit 0 || +goto start + +:exit1 +exit 1 || +goto start + +:pxelnx +# set 210:string https://bas.stfu-kthx.net:8888/ +# chain \${210:string}pxelinux.0 || goto start +# chain https://bas.stfu-kthx.net:8888/pxelinux.0 +# set next-server bas-stfu-kthx.net:8888 +# set 209:string https://bas.stfu-kthx.net:8888/pxelinux.cfg +# imgload pxelinux.0 +set net0/next-server 10.8.102.124 || +set netX/next-server 10.8.102.124 || +set next-server 10.8.102.124 || +# set 209:string pxelinux.cfg/default +# set 210:string bas.stfu-kthx.net +# shell || +boot tftp://10.8.102.124/pxelinux.0 || +goto start + +:c32boot +set net0/next-server 10.8.102.124 || +set netX/next-server 10.8.102.124 || +set next-server 10.8.102.124 || +boot tftp://10.8.102.124/chain.c32 || +goto start + +:sh +shell || +goto start \ No newline at end of file diff --git a/server/ipxe/exitTestScript.ipxe b/server/ipxe/exitTestScript.ipxe deleted file mode 100644 index 51ca1bc..0000000 --- a/server/ipxe/exitTestScript.ipxe +++ /dev/null @@ -1,57 +0,0 @@ -#!ipxe -dhcp - -:start -menu Please choose a webserver to load the ipxe menu: -item reg Registration -item pxelnx PxeLinux -item c32boot C32Boot -item exit Exit -item exit0 Exit0 -item exit1 Exit1 -item sh [Shell] -choose target && goto ${target} - -:reg -set crosscert http://ca.ipxe.org/auto/ -chain --replace https://bas.stfu-kthx.net:8888/api/ipxe/load/registration || -goto start - -:exit -exit || -goto start - -:exit0 -exit 0 || -goto start - -:exit1 -exit 1 || -goto start - -:pxelnx -# set 210:string https://bas.stfu-kthx.net:8888/ -# chain \${210:string}pxelinux.0 || goto start -# chain https://bas.stfu-kthx.net:8888/pxelinux.0 -# set next-server bas-stfu-kthx.net:8888 -# set 209:string https://bas.stfu-kthx.net:8888/pxelinux.cfg -# imgload pxelinux.0 -set net0/next-server 10.8.102.124 || -set netX/next-server 10.8.102.124 || -set next-server 10.8.102.124 || -# set 209:string pxelinux.cfg/default -# set 210:string bas.stfu-kthx.net -# shell || -boot tftp://bas.stfu-kthx.net/pxelinux.0 || -goto start - -:c32boot -set net0/next-server 10.8.102.124 || -set netX/next-server 10.8.102.124 || -set next-server 10.8.102.124 || -boot tftp://10.8.102.124/chain.c32 || -goto start - -:sh -shell || -goto start \ No newline at end of file diff --git a/server/ipxe/ipxe.0 b/server/ipxe/ipxe.0 new file mode 100644 index 0000000..aa09a89 Binary files /dev/null and b/server/ipxe/ipxe.0 differ diff --git a/server/ipxe/main.ipxe b/server/ipxe/main.ipxe index f77e58d..e470108 100644 --- a/server/ipxe/main.ipxe +++ b/server/ipxe/main.ipxe @@ -1,28 +1,6 @@ #!ipxe -dhcp +ifopen +shell -# Wallpaper -set img http://christophermckinney.net/wp-content/uploads/2017/08/Wallpaper.png -console --picture ${img} --x 800 --y 600 - -:start -menu Please choose a webserver to load the ipxe menu: -item js Jannik -item uw Udo -item ch Chris -item sh [Shell] -choose target && goto ${target} - -:js -set crosscert http://ca.ipxe.org/auto/ -chain --replace https://bas.stfu-kthx.net:8888/api/ipxe/load/script || -goto start -:uw -chain http://10.4.9.115/boot.php || -goto start -:ch -chain http://10.4.9.122/boot.php || -goto start -:sh -shell || -goto start +#set crosscert http://ca.ipxe.org/auto/ +chain https://bas.stfu-kthx.net:8888/api/configloader/${uuid} \ No newline at end of file diff --git a/server/ipxe/registration.ipxe b/server/ipxe/registration.ipxe index 51d89f2..1011765 100644 --- a/server/ipxe/registration.ipxe +++ b/server/ipxe/registration.ipxe @@ -1,5 +1,4 @@ #!ipxe -dhcp # Wallpaper set crosscert http://ca.ipxe.org/auto/ @@ -10,22 +9,31 @@ console --picture ${img} --x 800 --y 600 || shell :start menu Initializing client registration -item --key i init Initialize +item --key a automatic Automatic registration +item --key m manual Manual registration item --key l localboot Localboot item --key r reboot Reboot item --key p poweroff Power Off item --key s sh [Shell] -choose --default init --timeout 15000 target && goto ${target} || goto init +choose --default automatic --timeout 15000 target && goto ${target} || goto automatic :localboot exit0 || exit1 || goto start -:init +:automatic +params +param name unnamed +param mac ${net0/mac} +param uuid ${uuid} +param ip ${net0/ip} +chain https://bas.stfu-kthx.net:8888/api/registrations/add##params + +:manual params param id 0 -chain https://bas.stfu-kthx.net:8888/api/registration/group##params || +chain https://bas.stfu-kthx.net:8888/api/registrations/group##params || goto start :reboot @@ -35,12 +43,12 @@ reboot poweroff :sh -#login -echo Enter the password to access the shell -read pw -iseq ${pw} shell || goto start -clear pw -#iseq ${password} sh || goto start -#clear username -#clear password +login +#echo Enter the password to access the shell +#read pw +#iseq ${pw} shell || goto start +#clear pw +iseq ${password} sh || goto start +clear username +clear password shell \ No newline at end of file -- cgit v1.2.3-55-g7522