From 493684d9a6d22dc86f8260fe8cc4244ba71b5e9e Mon Sep 17 00:00:00 2001 From: pmikus Date: Thu, 25 Mar 2021 18:38:33 +0000 Subject: FIX: VPP version file name based on OS Signed-off-by: pmikus Change-Id: Icab8b87498e8487268857bb04c5ba7069d9297e3 --- resources/libraries/bash/function/common.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'resources/libraries/bash') diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index f8b0f0be2a..a3878015f9 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -723,23 +723,23 @@ function select_arch_os () { set -exuo pipefail - os_id=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') || { - die "Get OS release failed." - } + source /etc/os-release || die "Get OS release failed." - case "${os_id}" in + case "${ID}" in "ubuntu"*) - IMAGE_VER_FILE="VPP_DEVICE_IMAGE_UBUNTU" - VPP_VER_FILE="VPP_STABLE_VER_UBUNTU_BIONIC" - PKG_SUFFIX="deb" - ;; - "centos"*) - IMAGE_VER_FILE="VPP_DEVICE_IMAGE_CENTOS" - VPP_VER_FILE="VPP_STABLE_VER_CENTOS" - PKG_SUFFIX="rpm" + case "${VERSION}" in + *"LTS (Focal Fossa)"*) + IMAGE_VER_FILE="VPP_DEVICE_IMAGE_UBUNTU" + VPP_VER_FILE="VPP_STABLE_VER_UBUNTU_FOCAL" + PKG_SUFFIX="deb" + ;; + *) + die "Unsupported Ubuntu version!" + ;; + esac ;; *) - die "Unable to identify distro or os from ${os_id}" + die "Unsupported distro or OS!" ;; esac -- cgit 1.2.3-korg