diff options
author | Deepak S <deepak.s@linux.intel.com> | 2017-05-25 10:58:29 +0000 |
---|---|---|
committer | Deepak S <deepak.s@linux.intel.com> | 2017-07-17 01:06:35 -0700 |
commit | fd2fafde700c0b1e41292225dc7004988ad96d38 (patch) | |
tree | 00f44367b379d7fd1092125b2b7c3fc920883429 | |
parent | 422557ba5c56a48e14c5eea80c06efaf4e635395 (diff) |
Fix adding right deb repo based on the distro we are running on
JIRA: YARDSTICK-669
Change-Id: I0f3848b7803bc62c88effd00e850755e514893c4
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
-rwxr-xr-x | install.sh | 20 | ||||
-rwxr-xr-x | nsb_setup.sh | 2 |
2 files changed, 15 insertions, 7 deletions
diff --git a/install.sh b/install.sh index ad14b8e0b..3e151db94 100755 --- a/install.sh +++ b/install.sh @@ -14,6 +14,7 @@ DOCKER_ARCH="$(uname -m)" UBUNTU_PORTS_URL="http://ports.ubuntu.com/ubuntu-ports/" UBUNTU_ARCHIVE_URL="http://archive.ubuntu.com/ubuntu/" +source /etc/os-release source_file=/etc/apt/sources.list if [[ "${DOCKER_ARCH}" == "aarch64" ]]; then @@ -33,18 +34,25 @@ else fi sed -i -e 's/^deb-src /# deb-src /g' "${source_file}" -echo "APT::Default-Release \"trusty\";" > /etc/apt/apt.conf.d/default-distro + +VERSION_CODENAME=${VERSION_CODENAME:-trusty} + +echo "APT::Default-Release \""${VERSION_CODENAME}"\";" > /etc/apt/apt.conf.d/default-distro sub_source_file=/etc/apt/sources.list.d/yardstick.list touch "${sub_source_file}" # first add xenial repo needed for installing qemu_static_user/xenial in the container # then add complementary architecture repositories in case the cloud image is of different arch -echo -e "deb [arch="${DOCKER_ARCH}"] "${DOCKER_REPO}" xenial-updates universe -deb [arch="${EXTRA_ARCH}"] "${EXTRA_REPO}" trusty main universe multiverse restricted -deb [arch="${EXTRA_ARCH}"] "${EXTRA_REPO}" trusty-updates main universe multiverse restricted -deb [arch="${EXTRA_ARCH}"] "${EXTRA_REPO}" trusty-security main universe multiverse restricted -deb [arch="${EXTRA_ARCH}"] "${EXTRA_REPO}" trusty-proposed main universe multiverse restricted" > "${sub_source_file}" +if [[ "${VERSION_CODENAME}" != "xenial" ]]; then + REPO_UPDATE="deb [arch="${DOCKER_ARCH}"] "${DOCKER_REPO}" xenial-updates universe" +fi + +echo -e ""${REPO_UPDATE}" +deb [arch="${EXTRA_ARCH}"] "${EXTRA_REPO}" "${VERSION_CODENAME}" main universe multiverse restricted +deb [arch="${EXTRA_ARCH}"] "${EXTRA_REPO}" "${VERSION_CODENAME}"-updates main universe multiverse restricted +deb [arch="${EXTRA_ARCH}"] "${EXTRA_REPO}" "${VERSION_CODENAME}"-security main universe multiverse restricted +deb [arch="${EXTRA_ARCH}"] "${EXTRA_REPO}" "${VERSION_CODENAME}"-proposed main universe multiverse restricted" > "${sub_source_file}" echo "vm.mmap_min_addr = 0" > /etc/sysctl.d/mmap_min_addr.conf diff --git a/nsb_setup.sh b/nsb_setup.sh index 05d1fd6db..88027d9bd 100755 --- a/nsb_setup.sh +++ b/nsb_setup.sh @@ -40,7 +40,7 @@ install_libs() { echo "Install libs needed to build and run NSB Testing..." apt-get update > /dev/null 2>&1 - pkg=(git build-essential python-dev virtualenv python-virtualenv virtualenv linux-headers-$(uname -r) unzip python-pip libpcap-dev) + pkg=(git build-essential python-dev virtualenv python-virtualenv virtualenv linux-headers-$(uname -r) unzip python-pip libpcap-dev cmake) for i in "${pkg[@]}"; do dpkg-query -W --showformat='${Status}\n' "${i}"|grep "install ok installed" if [ "$?" -eq "1" ]; then |