From 071f0d00a025744a35379653762d439b807367e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jaime=20Caama=C3=B1o=20Ruiz?= Date: Wed, 30 May 2018 16:34:22 +0200 Subject: [PATCH] sfc: enable vault repo for kernel packages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It may happen that kernel version running in the provided docker system image is not current and associated devel packages are not available in official repo. Enable vault archive repos to fetch them. Change-Id: I3dd3f112b238bd12f1b75f7a27b7c1e98578d311 Signed-off-by: Jaime Caamaño Ruiz --- .../sfc/Full_Deploy/setup-docker-image.sh | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/csit/suites/sfc/Full_Deploy/setup-docker-image.sh b/csit/suites/sfc/Full_Deploy/setup-docker-image.sh index b30e443140..eef3644551 100755 --- a/csit/suites/sfc/Full_Deploy/setup-docker-image.sh +++ b/csit/suites/sfc/Full_Deploy/setup-docker-image.sh @@ -4,21 +4,19 @@ set -o xtrace set -o nounset #Do not allow for unset variables #set -e #Exit script if a command fails -# bootstrap_centos WORK_DIR=`pwd` -if sudo yum install -y "kernel-devel-uname-r == $(uname -r)"; then - echo "Kernel-devel installed correctly" -else - echo "Warning: Errors issued when installing kernel-devel" -fi -APT="sudo yum install -y git kernel-debug-devel kernel-headers python-devel vim autoconf automake libtool systemd-units rpm-build openssl openssl-devel groff graphviz selinux-policy-devel python python-twisted-core python-zope-interface python-twisted-web PyQt4 python-six desktop-file-utils procps-ng wget" -if $APT; then - echo "Pacakges installed correctly" -else - echo "Installation of packages failed" - exit 1 -fi +# bootstrap_centos +EL_VERSION=$(grep -oP '\d+\.\d+.\d+' /etc/centos-release) +K_VERSION=$(uname -r) +APT="sudo yum update -y centos-release" +$APT || (echo "Failed to update centos release info" && exit 1) + +APT="sudo yum install -y --enablerepo=C${EL_VERSION}-base --enablerepo=C${EL_VERSION}-updates kernel-devel-${K_VERSION} kernel-debug-devel-${K_VERSION} kernel-headers-${K_VERSION}" +$APT || (echo "Failed to install kernel devel packages" && exit 1) + +APT="sudo yum install -y git python-devel vim autoconf automake libtool systemd-units rpm-build openssl openssl-devel groff graphviz selinux-policy-devel python python-twisted-core python-zope-interface python-twisted-web PyQt4 python-six desktop-file-utils procps-ng wget" +$APT || (echo "Failed to install ovs requirement packages" && exit 1) cd $WORK_DIR [ -e configure-ovs.sh ] || \ @@ -43,7 +41,7 @@ git am ../ovs_nsh_patches/v2.6.1/*.patch #compile ovs ./boot.sh -./configure --with-linux=/lib/modules/`uname -r`/build --prefix=/usr/local +./configure --with-linux=/lib/modules/${K_VERSION}/build --prefix=/usr/local make rpm-fedora RPMBUILD_OPT="--without check --without libcapng" make DESTDIR=$WORK_DIR/ovs_install/openvswitch_2.6.1 install -- 2.36.6