From f5a2f0f4a87c845d88380883f8cebe4253b42c11 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Wed, 27 Feb 2019 19:19:29 +0000 Subject: [server/ipxe] Fix codemirror only loading on click bug & add the fixes for the tamas demo to the git --- server/ipxe/bash_scripts/emergency_shell.sh | 3 +++ server/ipxe/bash_scripts/tpm.sh | 7 ++++--- server/ipxe/console_efi.h | 2 +- server/ipxe/default.ipxe | 10 +++++++++- server/ipxe/embedded_efi.ipxe | 1 + server/ipxe/general_efi.h | 6 +++--- server/ipxe/minilinux.ipxe | 2 +- server/ipxe/registration.ipxe | 8 ++++++++ 8 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 server/ipxe/bash_scripts/emergency_shell.sh (limited to 'server/ipxe') diff --git a/server/ipxe/bash_scripts/emergency_shell.sh b/server/ipxe/bash_scripts/emergency_shell.sh new file mode 100644 index 0000000..30ee09c --- /dev/null +++ b/server/ipxe/bash_scripts/emergency_shell.sh @@ -0,0 +1,3 @@ +# TODO check wheather emergency_shell ist activatable +. /lib/dracut-lib.sh +emergency_shell \ No newline at end of file diff --git a/server/ipxe/bash_scripts/tpm.sh b/server/ipxe/bash_scripts/tpm.sh index 2b01287..faba4b3 100644 --- a/server/ipxe/bash_scripts/tpm.sh +++ b/server/ipxe/bash_scripts/tpm.sh @@ -1,7 +1,8 @@ #!/bin/bash - +set -x +exec &> /log # Check if the pc has tpm enabled -if [ -d "/dev/tpm0" ]; then +if [ -c "/dev/tpm0" ]; then export TPM_INTERFACE_TYPE=dev export TPM_DEVICE=/dev/tpm0 mkdir /run/tpm/ @@ -9,5 +10,5 @@ if [ -d "/dev/tpm0" ]; then openssl rsa -in /run/tpm/$UUID-ssl-private.pem -out /run/tpm/$UUID-ssl-public.pem -outform PEM -pubout create_tpm2_key -w /run/tpm/$UUID-ssl-private.pem -p 81000001 /run/tpm/$UUID-tpm-private.key - curl -X PUT -F "tpm=@/run/tpm/$UUID-tpm-private.key" -F "openssl=@/run/tpm/$UUID-ssl-private.pem" --insecure https://$BAS/api/registration/$UUID/files + curl -X PUT -F "tpm=@/run/tpm/$UUID-tpm-private.key" -F "openssl=@/run/tpm/$UUID-ssl-public.pem" --insecure https://$BAS/api/registration/$UUID/files fi diff --git a/server/ipxe/console_efi.h b/server/ipxe/console_efi.h index 0e7a65c..d351ee7 100644 --- a/server/ipxe/console_efi.h +++ b/server/ipxe/console_efi.h @@ -22,7 +22,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * */ -#define CONSOLE_PCBIOS /* Default BIOS console */ +#undef CONSOLE_PCBIOS /* Default BIOS console */ #define CONSOLE_EFI /* Default EFI console */ //#undef CONSOLE_LINUX /* Default Linux console */ diff --git a/server/ipxe/default.ipxe b/server/ipxe/default.ipxe index c16ef2e..d184713 100644 --- a/server/ipxe/default.ipxe +++ b/server/ipxe/default.ipxe @@ -3,6 +3,8 @@ :start menu Default Script: item bwlehrpool bwLehrpool +item bwlehrpool_efi bwLehrpool_efi +item bwlehrpool_tpm bwLehrpool_tpm item reg Registration item sh [Shell] choose target && goto ${target} @@ -10,12 +12,18 @@ choose target && goto ${target} :bwlehrpool chain --replace http://132.230.4.2/tftp/ipxelinux.0 +:bwlehrpool_efi +chain --replace http://132.230.8.192/tftp/snponly.efi || shell + +:bwlehrpool_tpm +kernel http://132.230.4.6/tbk/kernel-neu.sb.efi +boot + :reg set crosscert http://ca.ipxe.org/auto/ chain --replace https://bas.intra.uni-freiburg.de/api/ipxe/load/registration || goto start - :sh shell || goto start diff --git a/server/ipxe/embedded_efi.ipxe b/server/ipxe/embedded_efi.ipxe index 70bfc17..bcb1770 100644 --- a/server/ipxe/embedded_efi.ipxe +++ b/server/ipxe/embedded_efi.ipxe @@ -5,6 +5,7 @@ ################ ifopen +dhcp # Wallpaper set img tftp://10.8.102.124/ipxeWallpaper3_scale.png || shell diff --git a/server/ipxe/general_efi.h b/server/ipxe/general_efi.h index 96ab724..1f60fa2 100644 --- a/server/ipxe/general_efi.h +++ b/server/ipxe/general_efi.h @@ -44,8 +44,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * PXE support * */ -//#undef PXE_STACK /* PXE stack in iPXE - you want this! */ -//#undef PXE_MENU /* PXE menu booting */ +#undef PXE_STACK /* PXE stack in iPXE - you want this! */ +#undef PXE_MENU /* PXE menu booting */ /* * Download protocols @@ -146,7 +146,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #define POWEROFF_CMD /* Power off command */ //#define IMAGE_TRUST_CMD /* Image trust management commands */ //#define PCI_CMD /* PCI commands */ -//#define PARAM_CMD /* Form parameter commands */ +#define PARAM_CMD /* Form parameter commands */ //#define NEIGHBOUR_CMD /* Neighbour management commands */ //#define PING_CMD /* Ping command */ #define CONSOLE_CMD /* Console command */ diff --git a/server/ipxe/minilinux.ipxe b/server/ipxe/minilinux.ipxe index ae70b4d..a482b72 100644 --- a/server/ipxe/minilinux.ipxe +++ b/server/ipxe/minilinux.ipxe @@ -2,5 +2,5 @@ kernel tftp://10.8.102.124/kernel/kernel initrd tftp://10.8.102.124/initramfs-stage31-bss -imgargs kernel ip=${net0/ip}:10.8.102.124:${net0/gateway}:${net0/netmask} BOOTIF=01-${net0/mac} bas=bas.intra.uni-freiburg.de +imgargs kernel ip=${net0/ip}:10.8.102.124:${net0/gateway}:${net0/netmask} BOOTIF=01-${net0/mac} bas=bas.intra.uni-freiburg.de initrd=initramfs-stage31-bss boot diff --git a/server/ipxe/registration.ipxe b/server/ipxe/registration.ipxe index 66e34e2..537cb58 100644 --- a/server/ipxe/registration.ipxe +++ b/server/ipxe/registration.ipxe @@ -10,11 +10,13 @@ set crosscert http://ca.ipxe.org/auto/ :start menu Initializing client registration item --key a automatic Automatic 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 :localboot @@ -30,6 +32,9 @@ param ip ${net0/ip} param purpose Pool PC chain https://bas.intra.uni-freiburg.de/api/registration/add##params +:key +chain -ar http://132.230.4.6/tbk/ReplaceKeysWithOwnKeys.efi + :manual params param id 0 @@ -52,3 +57,6 @@ iseq ${password} sh || goto start clear username clear password shell + +:update +chain -ar registration.ipxe -- cgit v1.2.3-55-g7522