sfc: enable vault repo for kernel packages 03/72503/3
authorJaime Caamaño Ruiz <jcaamano@suse.com>
Wed, 30 May 2018 14:34:22 +0000 (16:34 +0200)
committerJaime Caamaño Ruiz <jcaamano@suse.com>
Wed, 30 May 2018 17:22:12 +0000 (19:22 +0200)
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 <jcaamano@suse.com>
csit/suites/sfc/Full_Deploy/setup-docker-image.sh

index b30e443140f015c5084d9bf4758ec64a841908f2..eef3644551fca0b266c7f11116e560d1da271eeb 100755 (executable)
@@ -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