summaryrefslogtreecommitdiffstats
path: root/server/ipxe
diff options
context:
space:
mode:
authorJannik Schönartz2018-08-28 19:35:51 +0200
committerJannik Schönartz2018-08-28 19:35:51 +0200
commit17759278184463f84e2dfdbaa93882d0d3dd5423 (patch)
treeb79822af67ac41edeea1e9e7cea0c8dc8353cfbd /server/ipxe
parent[configloader] made the code actually work (diff)
downloadbas-17759278184463f84e2dfdbaa93882d0d3dd5423.tar.gz
bas-17759278184463f84e2dfdbaa93882d0d3dd5423.tar.xz
bas-17759278184463f84e2dfdbaa93882d0d3dd5423.zip
[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.
Diffstat (limited to 'server/ipxe')
-rw-r--r--server/ipxe/default.ipxe (renamed from server/ipxe/exitTestScript.ipxe)11
-rw-r--r--server/ipxe/ipxe.0bin0 -> 90057 bytes
-rw-r--r--server/ipxe/main.ipxe30
-rw-r--r--server/ipxe/registration.ipxe34
4 files changed, 34 insertions, 41 deletions
diff --git a/server/ipxe/exitTestScript.ipxe b/server/ipxe/default.ipxe
index 51ca1bc..e070ca6 100644
--- a/server/ipxe/exitTestScript.ipxe
+++ b/server/ipxe/default.ipxe
@@ -1,8 +1,12 @@
#!ipxe
-dhcp
+
+# 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
@@ -12,6 +16,9 @@ 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 ||
@@ -42,7 +49,7 @@ 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 ||
+boot tftp://10.8.102.124/pxelinux.0 ||
goto start
:c32boot
diff --git a/server/ipxe/ipxe.0 b/server/ipxe/ipxe.0
new file mode 100644
index 0000000..aa09a89
--- /dev/null
+++ b/server/ipxe/ipxe.0
Binary files 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