summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAdrian Reber <adrian@lisas.de>2018-12-19 21:48:38 +0100
committerAdrian Reber <adrian@lisas.de>2018-12-21 08:18:21 +0100
commit38e3fb53f638ce79811ef2b4ec6bd00ac6d761ae (patch)
treecb36477d95e3e7abd9cf6210f49b96c7bed27891 /contrib
parentfa998f224fb7aa15d85b09dfdc4491dc09c9e390 (diff)
downloadpodman-38e3fb53f638ce79811ef2b4ec6bd00ac6d761ae.tar.gz
podman-38e3fb53f638ce79811ef2b4ec6bd00ac6d761ae.tar.bz2
podman-38e3fb53f638ce79811ef2b4ec6bd00ac6d761ae.zip
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 <adrian@lisas.de>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/cirrus/lib.sh44
1 files changed, 36 insertions, 8 deletions
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 <<EOF
+[adrian-criu-el7]
+name=Copr repo for criu-el7 owned by adrian
+baseurl=https://copr-be.cloud.fedoraproject.org/results/adrian/criu-el7/epel-7-$basearch/
+type=rpm-md
+skip_if_unavailable=True
+gpgcheck=1
+gpgkey=https://copr-be.cloud.fedoraproject.org/results/adrian/criu-el7/pubkey.gpg
+repo_gpgcheck=0
+enabled=1
+enabled_metadata=1
+EOF
+ ooe.sh sudo yum -y install criu
+ elif [[ "$OS_RELEASE_ID" =~ "fedora" ]]; then
+ echo "Using CRIU from distribution"
+ else
+ 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/
+ fi
}
# Runs in testing VM, not image building