From 62ffd9f052bb0b5fd956b2ad005c6f337d2acc69 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 15 Feb 2019 11:40:22 +0100 Subject: [SSUS] Fix stuff --- satellit_upgrader/updater.template.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 7ea0bca..0ec291f 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -189,7 +189,7 @@ if [ -n "$TGZ_SLXADMIN" ]; then ${DO_UPDATE:-perror} "This update seems to be older than the server version you're currently running" fi if [ -z "$DO_UPDATE" ]; then - echo "If you want to install this upate, run again with --update parameter:" + echo "If you want to install this update, run again with --update parameter:" echo "eg. sh $0 --update" exit 0 fi @@ -247,19 +247,27 @@ if diffcp "tm-sudo-config" "/etc/sudoers.d/taskmanager" "Installing new sudo con fi # ************************** IPXE ************************** +echo "* iPXE" IPXE_PID= -if [ -n "$TGZ_IPXE" ]; then +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" + 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 [ -e "$TMPDIR/$TGZ_IPXE" ] || perror "$TGZ_IPXE missing from payload" - echo "* iPXE source code" - echo "Extracting" + echo "Extracting new version from tarball" rm -rf -- "$PATH_IPXE" mkdir -p "$PATH_IPXE" tar -x -C "$PATH_IPXE" -f "$TMPDIR/$TGZ_IPXE" || perror "Could not extract $TGZ_IPXE to $PATH_IPXE" fixperms "$PATH_IPXE" taskmanager:taskmanager + # Trigger default compile in the background so the next regen doesn't take too long + build=true +fi +if $build; then echo "Resetting pxe menu" mysql -e 'UPDATE openslx.property SET value = "invalid" WHERE name = "server-ip"' || pwarning "Could not reset pxe menu status; manual regeneration of menu required" - echo "iPXE upgrade complete" - # Trigger default compile in the background so the next regen doesn't take too long { cd "$PATH_IPXE/src" && sudo -n -u taskmanager nice -n 10 make -j2 bin/undionly.kkkpxe > /dev/null 2>&1 } & @@ -278,7 +286,7 @@ if [ -n "$TGZ_SLXADMIN" ]; then # Remember boot module if already set bootmodule=$( basename "$( readlink -f "$PATH_SLXADMIN/modules/serversetup" 2> /dev/null )" ) # Remove old files - wipe selectively, just in case someone added a new module by hand - rm -rf -- "$PATH_SLXADMIN/"{inc,apis,modules,templates,Mustache,script,style} + rm -rf -- "$PATH_SLXADMIN/"{inc,apis,modules,templates,Mustache,script,style,modules-available/serversetup-bwlp} while read -r line || [[ -n "$line" ]]; do rm -rf -- "$PATH_SLXADMIN/$line" done < "$INCMODS" @@ -320,6 +328,7 @@ if [ -n "$TGZ_SLXADMIN" ]; then if [ -z "$bootmodule" ] || ! [ -d "$PATH_SLXADMIN/modules-available/$bootmodule" ]; then bootmodule="serversetup-bwlp-pxelinux" if [ -t 0 ] && [ -t 1 ]; then + echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" echo "Congratulations! You have won a bwLehrpool-Server with iPXE support!" echo "Do you want to enable iPXE boot support instead of the old ipxelinux4 approach?" echo -n "If unsure, say NO here. [y/n]: " @@ -668,7 +677,7 @@ count=0 echo -n "." sleep 2 count=$(( count + 1 )) - [ "$count" -gt 5 ] && break + [ "$count" -gt 7 ] && break done # ************************** LIGHTY ************************ -- cgit v1.2.3-55-g7522