From a12ffd379cc3328aa67ec1273c366455e131a810 Mon Sep 17 00:00:00 2001 From: krionbsd Date: Fri, 7 May 2021 18:32:42 +0200 Subject: [PATCH] Add a stubber support for Ubuntu 21.04 non-LTS to use Ubuntu 20.04 packages. --- bootstrap-salt.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 3cc175e..1ac3931 100644 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1457,6 +1457,9 @@ __ubuntu_codename_translation() { "20") DISTRO_CODENAME="focal" ;; + "21") + DISTRO_CODENAME="hirsute" + ;; *) DISTRO_CODENAME="trusty" ;; @@ -2911,7 +2914,7 @@ __enable_universe_repository() { } __install_saltstack_ubuntu_repository() { - # Workaround for latest non-LTS ubuntu + # Workaround for non-LTS ubuntu 20.10 if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; }; then echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems." UBUNTU_VERSION=20.04 @@ -2921,6 +2924,16 @@ __install_saltstack_ubuntu_repository() { UBUNTU_CODENAME=${DISTRO_CODENAME} fi + # Workaround for latest non-LTS ubuntu 21.04 + if { [ "$DISTRO_MAJOR_VERSION" -eq 21 ] && [ "$DISTRO_MINOR_VERSION" -eq 04 ]; }; then + echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems." + UBUNTU_VERSION=20.04 + UBUNTU_CODENAME="focal" + else + UBUNTU_VERSION=${DISTRO_VERSION} + UBUNTU_CODENAME=${DISTRO_CODENAME} + fi + # Install downloader backend for GPG keys fetching __PACKAGES='wget' @@ -3035,7 +3048,7 @@ install_ubuntu_stable_deps() { if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then - if [ "$DISTRO_MAJOR_VERSION" -ge 20 ]; then + if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ]; then __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1 else __apt_get_install_noinput --allow-unauthenticated debian-archive-keyring &&