From 7c81c9c88ec0ca38e106d1d7635a303a60e99928 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 15 Feb 2019 15:26:14 +0100 Subject: [SSUS] Apply our desired config to ipxe --- satellit_upgrader/updater.template.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 0ec291f..4928e6f 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -253,6 +253,8 @@ build=false if grep -qF 'https://git.openslx.org/openslx-ng/ipxe.git' "$PATH_IPXE/.git/config"; then echo "Updating existing clone" cd "$PATH_IPXE" + # Reset modified config, in case the files have changed upstream; will be re-applied below + failprint sudo -n -u taskmanager git checkout src/config failprint sudo -n -u taskmanager git pull --all || pwarning "Could not update iPXE -- let's hope the old version still works." build=true elif [ -n "$TGZ_IPXE" ]; then @@ -267,6 +269,24 @@ elif [ -n "$TGZ_IPXE" ]; then fi if $build; then echo "Resetting pxe menu" + ipxe_enable () { + local var + while [ $# -gt 0 ]; do + var="$1" + sed -i -r "s~^\\s*(//\\s*#define|#undef)\\s+${var}(\\s|$)~#define ${var} /* enabled by bwLehrpool */\\2~" "$PATH_IPXE"/src/config/*.h || pwarning "Could not enable iPXE option $var" + shift + done + } + ipxe_disable () { + local var + while [ $# -gt 0 ]; do + var="$1" + sed -i -r "s~^\\s*(//\\s*#undef|#define)\\s+${var}(\\s|\$)~#undef ${var} /* disabled by bwLehrpool */\\2~" "$PATH_IPXE"/src/config/*.h || pwarning "Could not disable iPXE option $var" + shift + done + } + ipxe_enable CONSOLE_FRAMEBUFFER CONSOLE_CMD MENU_CMD PARAM_CMD DOWNLOAD_PROTO_HTTPS IMAGE_PNG NVO_CMD IFMGMT_CMD LOGIN_CMD SHELL_CMD MENU_CMD REBOOT_CMD POWEROFF_CMD + ipxe_disable NET_PROTO_STP NET_PROTO_LACP CRYPTO_80211_WEP CRYPTO_80211_WPA CRYPTO_80211_WPA2 IWMGMT_CMD IBMGMT_CMD FCMGMT_CMD CONSOLE_SERIAL mysql -e 'UPDATE openslx.property SET value = "invalid" WHERE name = "server-ip"' || pwarning "Could not reset pxe menu status; manual regeneration of menu required" { cd "$PATH_IPXE/src" && sudo -n -u taskmanager nice -n 10 make -j2 bin/undionly.kkkpxe > /dev/null 2>&1 @@ -489,10 +509,6 @@ echo "* TFTP" # ************************** TFTP ************************** if [ -n "$TGZ_TFTP" ]; then - # TODO: - # ipxelinux.0 -> undionly.kkkpxe - # Convert & Remove other menus - # Redirect 2x lighttpd [ -e "$TMPDIR/$TGZ_TFTP" ] || perror "$TGZ_TFTP missing from payload" echo "Extracting tftp server dir contents" rm -rf -- "$PATH_TFTP/v4" "$PATH_TFTP/v6" "$PATH_TFTP/ipxelinux.0" "$PATH_TFTP/pxelinux.0" -- cgit v1.2.3-55-g7522