aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/bash/function
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2021-03-25 18:38:33 +0000
committerPeter Mikus <pmikus@cisco.com>2021-03-29 06:26:28 +0000
commit493684d9a6d22dc86f8260fe8cc4244ba71b5e9e (patch)
tree47a19009d1a2438f0ac0220a269257280611ebee /resources/libraries/bash/function
parent9f0ea4e6be697aa8ca08a6da596d7ca5892d2183 (diff)
FIX: VPP version file name based on OS
Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: Icab8b87498e8487268857bb04c5ba7069d9297e3
Diffstat (limited to 'resources/libraries/bash/function')
-rw-r--r--resources/libraries/bash/function/common.sh26
1 files changed, 13 insertions, 13 deletions
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