summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-15 15:26:14 +0100
committerSimon Rettberg2019-02-15 15:26:14 +0100
commit7c81c9c88ec0ca38e106d1d7635a303a60e99928 (patch)
tree33927af9860da8279a5e46bb21ac39239cb44ee2
parent[SSUS] Fix stuff (diff)
downloadsetup-scripts-7c81c9c88ec0ca38e106d1d7635a303a60e99928.tar.gz
setup-scripts-7c81c9c88ec0ca38e106d1d7635a303a60e99928.tar.xz
setup-scripts-7c81c9c88ec0ca38e106d1d7635a303a60e99928.zip
[SSUS] Apply our desired config to ipxe
-rw-r--r--satellit_upgrader/updater.template.sh24
1 files 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"