From 67c930b70f53d4bf92c42f7a99888180437ec368 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 28 Mar 2019 10:22:40 +0100 Subject: [SSUS] Handle updating old Debian 8 32Bit installs --- satellit_upgrader/updater.template.sh | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index 478ce81..24b4055 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -125,6 +125,16 @@ aptinst () { if ! dpkg -l "$pkg" 2> /dev/null | grep -q "^ii\\s.*$pkg"; then if ! $aptupdate; then echo "Updating apt db" + # Kill this file; was accidentally put there on stretch; on jessie it's not + # supported anymore as of 2019-03-20 + rm -f -- "/etc/apt/sources.list.d/10-added_repos.list" + # No more updates for pre-point release updates on jessie + if [ "$MAJOR" -eq 8 ]; then + sed -r -i '/^\s*[^#].*jessie-updates/s/^/#/' "/etc/apt/sources.list" + elif [ "$MAJOR" -eq 9 ]; then + # But re-enable (in case it was dist-upgraded) + sed -r -i '/^\s*#.*jessie-updates/s/^\s*#//;s/jessie-updates/stretch-updates/' "/etc/apt/sources.list" + fi failprint apt-get update || perror "Cannot run apt-get update" aptupdate=true fi @@ -165,6 +175,20 @@ declare -rg PATH_LDADP="/opt/ldadp" declare -rg PATH_DNBD3="/opt/openslx/dnbd3" declare -rg PACKAGE_LIBJANSSON="libjansson-dev" # needed by dnbd3 +if [ "$MAJOR" -eq 8 ]; then + echo "* * * * * * * * * * * * * * * * * * *" + echo "* !! WARNING !! *" + echo "* This Server is still running *" + echo "* Debian 8, which will cease to *" + echo "* receive security updates as of *" + echo "* June 2020. Consider upgrading to *" + echo "* Debian 9 by dist-upgrading, or *" + echo "* Install the latest bwLehrpool *" + echo "* Satellite server and import your *" + echo "* old config. *" + echo "* * * * * * * * * * * * * * * * * * *" +fi + # ** Check if constants have been filled, bail out otherwise if [ -z "$TARGET_WEBIF_VERSION" ] || [[ "$TARGET_WEBIF_VERSION" == %*% ]]; then [ -n "$TGZ_SLXADMIN" ] && perror "Bad upgrader: TARGET_WEBIF_VERSION not set" @@ -645,19 +669,10 @@ if [ -n "$TGZ_LDADP" ]; then fi # ************************** tmate ************************ -if [ "$MAJOR" -gt 8 ]; then - # Kill this file; was accidentally put there on stretch - rm -f -- "/etc/apt/sources.list.d/10-added_repos.list" -fi -if ! which tmate &> /dev/null; then +if ! which tmate &> /dev/null && [ "$MAJOR" -ge 9 ]; then echo "* Installing tmate" - if [ "$MAJOR" -eq 8 ]; then - echo "deb http://ftp.debian.org/debian jessie-backports main" > "/etc/apt/sources.list.d/10-added_repos.list" - aptupdate=false - fi if ! aptinst tmate; then pwarning "Could not install tmate. Easy remote assistance will not be available." - [ "$MAJOR" -eq 8 ] && pwarning "Please check whether repo 'jessie-backports' was added and install by hand." fi echo "Writing config..." cat > /root/.tmate.conf <<-JUSTANOTHERDOC -- cgit v1.2.3-55-g7522