summaryrefslogtreecommitdiffstats
path: root/server/ipxe
diff options
context:
space:
mode:
authorJannik Schönartz2019-03-31 15:50:50 +0200
committerJannik Schönartz2019-03-31 15:50:50 +0200
commit0873cc0b67a5e3103f1efea8f3b6a18b116b0751 (patch)
tree7549966b862e400474c908b86871e17fa2d66961 /server/ipxe
parent[server/clients] add more responses (diff)
downloadbas-0873cc0b67a5e3103f1efea8f3b6a18b116b0751.tar.gz
bas-0873cc0b67a5e3103f1efea8f3b6a18b116b0751.tar.xz
bas-0873cc0b67a5e3103f1efea8f3b6a18b116b0751.zip
[server/registration] Performance improvements & add automatic registration with custom name
Manual registration now sends the client as json idoit: Add server bug fixes shell: Fix building pcbios ipxe version eslint fixes
Diffstat (limited to 'server/ipxe')
-rwxr-xr-xserver/ipxe/bash_scripts/addServer.sh2
-rw-r--r--server/ipxe/default.ipxe9
-rw-r--r--server/ipxe/registration.ipxe21
3 files changed, 21 insertions, 11 deletions
diff --git a/server/ipxe/bash_scripts/addServer.sh b/server/ipxe/bash_scripts/addServer.sh
index 69088bf..9ef8aa9 100755
--- a/server/ipxe/bash_scripts/addServer.sh
+++ b/server/ipxe/bash_scripts/addServer.sh
@@ -75,7 +75,7 @@ json_data() {
"parents": [$rack],
"type": "SERVER",
"name": "$hostname",
- "uuid": "$(dmidecode -q -s system-uuid | grep -v '^#' | head -n 1 | tr '[a-z]' '[A-Z]')",
+ "uuid": "$(dmidecode -q -s system-uuid | grep -v '^#' | head -n 1 | tr 'a-z' 'A-Z')",
"networks": [
$(parse_mgmt "$hostname"),
$(parse_ips "$hostname" "$interface")
diff --git a/server/ipxe/default.ipxe b/server/ipxe/default.ipxe
index 689f4f1..0be460a 100644
--- a/server/ipxe/default.ipxe
+++ b/server/ipxe/default.ipxe
@@ -5,12 +5,13 @@ menu Default Script:
item bwlehrpool bwLehrpool
item bwlehrpool_efi bwLehrpool_efi
item bwlehrpool_tpm bwLehrpool_tpm
-item reg Registration
-item sh [Shell]
+item --key r registration Registration
+item --key s sh [Shell]
choose target && goto ${target}
:bwlehrpool
-chain --replace http://132.230.4.2/tftp/ipxelinux.0
+#chain --replace http://132.230.4.2/tftp/ipxelinux.0
+chain --replace http://132.230.4.2/boot/ipxe
:bwlehrpool_efi
#chain --replace http://132.230.8.192/tftp/snponly.efi || shell
@@ -20,7 +21,7 @@ chain --replace http://132.230.8.197/tftp/snponly.efi || shell
kernel http://132.230.4.6/tbk/kernel-neu.sb.efi
boot
-:reg
+:registration
set crosscert http://ca.ipxe.org/auto/
chain --replace https://bas.intra.uni-freiburg.de/api/ipxe/load/registration ||
goto start
diff --git a/server/ipxe/registration.ipxe b/server/ipxe/registration.ipxe
index 53f4b01..505d72f 100644
--- a/server/ipxe/registration.ipxe
+++ b/server/ipxe/registration.ipxe
@@ -9,15 +9,16 @@ set crosscert http://ca.ipxe.org/auto/
:start
menu Initializing client registration
-item --key a automatic Automatic registration
+item --key a automatic Automatic Registration
+item --key c customname Automatic Registration (Custom Name)
+item --key m manual Manual Registration
item --key k key Replace Secure Boot Keys
-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]
item --key u update Reload Menufile
-choose --default automatic --timeout 15000 target && goto ${target} || goto automatic
+choose --default automatic --timeout 25000 target && goto ${target} || goto automatic
:localboot
exit0 ||
@@ -28,10 +29,15 @@ goto start
params
param ipxe true
param client { "type": "CLIENT", "uuid": "${uuid}", "purpose": "Pool PC", "networks": [{ "ip": "${net0/ip}", "mac": "${net0/mac}" }] }
-chain https://bas.intra.uni-freiburg.de/api/registration##params
+chain https://bas.intra.uni-freiburg.de/api/registration/clients##params
-:key
-chain -ar http://132.230.4.6/tbk/ReplaceKeysWithOwnKeys.efi
+:customname
+echo Enter client name
+read clientname
+params
+param ipxe true
+param client { "name": "${clientname}", "type": "CLIENT", "uuid": "${uuid}", "purpose": "Pool PC", "networks": [{ "ip": "${net0/ip}", "mac": "${net0/mac}" }] }
+chain https://bas.intra.uni-freiburg.de/api/registration/clients##params
:manual
params
@@ -39,6 +45,9 @@ param id 0
chain https://bas.intra.uni-freiburg.de/api/registration/group##params ||
goto start
+:key
+chain -ar http://132.230.4.6/tbk/ReplaceKeysWithOwnKeys.efi
+
:reboot
reboot