diff --git a/.ci/install_qemu.sh b/.ci/install_qemu.sh new file mode 100755 index 000000000..1ecf593a1 --- /dev/null +++ b/.ci/install_qemu.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# Copyright (c) 2018 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +QEMU_REPO="github.com/qemu/qemu" +QEMU_DIR="qemu" +KATA_QEMU_BRANCH="stable-2.11" +PACKAGING_REPO="github.com/kata-containers/packaging" +QEMU_CONFIG_SCRIPT="configure-hypervisor.sh" + +git clone "https://${QEMU_REPO}" + +# Get qemu configuration script and copy to +# the qemu repository +go get -d "$PACKAGING_REPO" || true +cp "${GOPATH}/src/${PACKAGING_REPO}/scripts/${QEMU_CONFIG_SCRIPT}" "${QEMU_DIR}" + +pushd "$QEMU_DIR" +git checkout "$KATA_QEMU_BRANCH" + +echo "Build Qemu" +eval "./${QEMU_CONFIG_SCRIPT}" "qemu" | xargs ./configure +make -j $(nproc) + +echo "Install Qemu" +sudo -E make install + +# Workaround: +# As we currently do not have a package that installs +# qemu under /usr/bin/, create a symlink. +# this should be solved when we define and have the packages +# in a repository. +sudo ln -sf $(command -v qemu-system-$(arch)) /usr/bin/ + +popd diff --git a/.ci/install_qemu_lite.sh b/.ci/install_qemu_lite.sh deleted file mode 100755 index 9afdc4f4a..000000000 --- a/.ci/install_qemu_lite.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2017-2018 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 -# - -set -e - -arch=$(arch) - -if [ "$#" -ne 3 ]; then - echo "Usage: $0 " - echo " Install the QEMU_LITE_VERSION from clear CLEAR_RELEASE." - exit 1 -fi - -clear_release="$1" -qemu_lite_version="$2" -distro="$3" -qemu_lite_bin="qemu-lite-bin-${qemu_lite_version}.${arch}.rpm" -qemu_lite_data="qemu-lite-data-${qemu_lite_version}.${arch}.rpm" - -echo -e "Install qemu-lite ${qemu_lite_version}" - -# download packages -curl -LO "https://download.clearlinux.org/releases/${clear_release}/clear/${arch}/os/Packages/${qemu_lite_bin}" -curl -LO "https://download.clearlinux.org/releases/${clear_release}/clear/${arch}/os/Packages/${qemu_lite_data}" - -# install packages -if [ "$distro" == "ubuntu" ]; then - sudo alien -i "./${qemu_lite_bin}" - sudo alien -i "./${qemu_lite_data}" -elif [ "$distro" == "fedora" ]; then - sudo rpm -ihv "./${qemu_lite_bin}" --nodeps - sudo rpm -ihv "./${qemu_lite_data}" --nodeps -fi - -# cleanup -rm -f "./${qemu_lite_bin}" -rm -f "./${qemu_lite_data}" diff --git a/.ci/setup.sh b/.ci/setup.sh index 377c30a39..b9e590dc3 100755 --- a/.ci/setup.sh +++ b/.ci/setup.sh @@ -35,6 +35,9 @@ else die "Unsupported architecture: $arch" fi +echo "Install Qemu" +bash -f ${cidir}/install_qemu.sh + echo "Install shim" bash -f ${cidir}/install_shim.sh diff --git a/.ci/setup_env_fedora.sh b/.ci/setup_env_fedora.sh index dfea34b3a..f48dccc2e 100755 --- a/.ci/setup_env_fedora.sh +++ b/.ci/setup_env_fedora.sh @@ -29,8 +29,9 @@ echo "Install kata containers dependencies" chronic sudo -E dnf -y groupinstall "Development tools" chronic sudo -E dnf -y install libtool automake autoconf bc pixman numactl-libs -echo "Install qemu-lite binary" -"${cidir}/install_qemu_lite.sh" "${qemu_lite_clear_release}" "${qemu_lite_sha}" "$ID" +echo "Install qemu dependencies" +chronic sudo -E dnf -y install libcap-devel libattr-devel \ + libcap-ng-devel zlib-devel pixman-devel librbd-dev echo "Install kata containers image" "${cidir}/install_kata_image.sh" diff --git a/.ci/setup_env_ubuntu.sh b/.ci/setup_env_ubuntu.sh index c5ccf219a..fb59e2058 100755 --- a/.ci/setup_env_ubuntu.sh +++ b/.ci/setup_env_ubuntu.sh @@ -25,8 +25,8 @@ if ! command -v docker > /dev/null; then "${cidir}/../cmd/container-manager/manage_ctr_mgr.sh" docker install fi -echo "Install qemu-lite binary" -"${cidir}/install_qemu_lite.sh" "${qemu_lite_clear_release}" "${qemu_lite_sha}" "$ID" +echo "Install qemu dependencies" +chronic sudo -E apt install -y libcap-dev libattr1-dev libcap-ng-dev librbd-dev echo "Install kata-containers image" "${cidir}/install_kata_image.sh"