From 38e3fb53f638ce79811ef2b4ec6bd00ac6d761ae Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Wed, 19 Dec 2018 21:48:38 +0100 Subject: Use existing CRIU packages in CI setup For all in testing involved distribution a new enough CRIU exists as a package. Fedora provides CRIU packages directly. For CentOS/RHEL there is a COPR with the latest CRIU version and for Ubuntu there is a PPA for the latest CRIU version. Let's use these packages and fall back to building from git if necessary. Signed-off-by: Adrian Reber --- contrib/cirrus/lib.sh | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'contrib/cirrus/lib.sh') diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index 3b567b7a7..12941a917 100644 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -248,18 +248,46 @@ install_conmon(){ } install_criu(){ + OS_RELEASE_ID=$(os_release_id) + OS_RELEASE_VER=$(os_release_ver) + echo "Installing CRIU" echo "Installing CRIU from commit $CRIU_COMMIT" + echo "Platform is $OS_RELEASE_ID" req_env_var " CRIU_COMMIT $CRIU_COMMIT " - DEST="/tmp/criu" - rm -rf "$DEST" - ooe.sh git clone https://github.com/checkpoint-restore/criu.git "$DEST" - cd $DEST - ooe.sh git fetch origin --tags - ooe.sh git checkout -q "$CRIU_COMMIT" - ooe.sh make - sudo install -D -m 755 criu/criu /usr/sbin/ + + if [[ "$OS_RELEASE_ID" =~ "ubuntu" ]]; then + ooe.sh sudo add-apt-repository ppa:criu/ppa + ooe.sh sudo apt-get update + ooe.sh sudo apt-get -y install criu + elif [[ ( "$OS_RELEASE_ID" =~ "centos" || "$OS_RELEASE_ID" =~ "rhel" ) && "$OS_RELEASE_VER" =~ "7"* ]]; then + echo "Configuring Repositories for latest CRIU" + ooe.sh sudo tee /etc/yum.repos.d/adrian-criu-el7.repo <