diff --git a/release/kata-deploy-binaries.sh b/release/kata-deploy-binaries.sh index b6abe3412..00b67d749 100755 --- a/release/kata-deploy-binaries.sh +++ b/release/kata-deploy-binaries.sh @@ -236,11 +236,11 @@ ${prefix}/bin/kata-runtime --kata-config "${prefix}/share/defaults/${project}/co EOT sudo chmod +x kata-qemu - cat < /etc/apt/sources.list -RUN echo "deb http://deb.debian.org/debian stable-updates main" >> /etc/apt/sources.list -RUN echo "deb http://security.debian.org stable/updates main" >> /etc/apt/sources.list -RUN dpkg --add-architecture $DPKG_ARCH - -RUN apt update && apt install -y \ - autoconf \ - automake \ - bc \ - bison \ - cpio \ - curl \ - flex \ - gawk \ - git \ - make \ - pkg-config \ - python \ - python-dev \ - rsync \ - gcc-$GEN_ARCH-linux-gnu \ - libaudit-dev:$DPKG_ARCH \ - libcap-dev:$DPKG_ARCH \ - libcap-ng-dev:$DPKG_ARCH \ - libdw-dev:$DPKG_ARCH \ - libelf-dev:$DPKG_ARCH \ - libglib2.0-0:$DPKG_ARCH \ - libglib2.0-dev:$DPKG_ARCH \ - zlib1g-dev:$DPKG_ARCH \ - librbd-dev:$DPKG_ARCH \ - libltdl-dev:$DPKG_ARCH \ - libpixman-1-dev:$DPKG_ARCH - -RUN cd .. && git clone --depth=1 "${NEMU_REPO}" nemu -RUN git fetch origin --tags && git checkout "${NEMU_VERSION}" -RUN git clone https://github.com/qemu/capstone.git capstone -RUN git clone https://github.com/qemu/keycodemapdb.git ui/keycodemapdb -ADD configure-hypervisor.sh /root/configure-hypervisor.sh -RUN curl -O http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-defaults/pkg-config-"${GEN_ARCH}"-linux-gnu_7.4.0-1ubuntu2.3_amd64.deb && dpkg -i pkg* - -ENV PKG_CONFIG_PATH $PKG_CONFIG_PATH:/usr/lib/"${GEN_ARCH}"-linux-gnu/pkgconfig/:/usr/"${GEN_ARCH}"-linux-gnu/lib/pkgconfig -RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s kata-nemu ${GEN_ARCH} | xargs ./configure \ - --with-pkgversion=kata-static -RUN make -j$($(nproc)-1) CONFIG_HID_DEV=y -RUN make install DESTDIR=/tmp/nemu-static - -RUN curl -O "${NEMU_OVMF}" && mv OVMF.fd /tmp/nemu-static/"${PREFIX}"/share/kata-nemu/ -RUN mv /tmp/nemu-static/"${PREFIX}"/bin/qemu-system-$GEN_ARCH /tmp/nemu-static/"${PREFIX}"/bin/nemu-system-$GEN_ARCH -RUN curl -O "${VIRTIOFSD_RELEASE}/${VIRTIOFSD}" && chmod +x ${VIRTIOFSD} && mv ${VIRTIOFSD} /tmp/nemu-static/"${PREFIX}"/bin/ - -RUN cd /tmp/nemu-static && tar -czvf kata-nemu-static.tar.gz * - diff --git a/static-build/nemu/Makefile b/static-build/nemu/Makefile deleted file mode 100644 index 7a8384d73..000000000 --- a/static-build/nemu/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -#Copyright (c) 2019 Intel Corporation -# -#SPDX-License-Identifier: Apache-2.0 -# - -MK_DIR :=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) -CONFIG_DIR := $(MK_DIR)/../../scripts/ - -build: - "$(MK_DIR)/build-static-nemu.sh" $(arch) - -clean: - rm -f kata-nemu-static.tar.gz diff --git a/static-build/nemu/build-static-nemu.sh b/static-build/nemu/build-static-nemu.sh deleted file mode 100755 index d934d489f..000000000 --- a/static-build/nemu/build-static-nemu.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2019 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -set -o errexit -set -o nounset -set -o pipefail - -script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -source "${script_dir}/../../scripts/lib.sh" -source "${script_dir}/../qemu.blacklist" - -config_dir="${script_dir}/../../scripts/" -nemu_tar="kata-static-nemu.tar.gz" -nemu_tmp_tar="kata-static-nemu-tmp.tar.gz" -Dockerfile="Dockerfile" - -if [ $# -ne 0 ];then - arch="$1" - case "$arch" in - aarch64) dpkg_arch="arm64" - Dockerfile="Dockerfile_cross" - ;; - ppc64le) arch="powerpc64le" - dpkg_arch="ppc64el" - Dockerfile="Dockerfile_cross" - ;; - s390x) dpkg_arch=$arch - Dockerfile="Dockerfile_cross" - ;; - x86_64) dpkg_arch="amd64" - arch="amd64" - ;; - *) die "$arch is not support for cross compile" ;; - esac -else - arch="" - dpkg_arch="" -fi - -nemu_repo="${nemu_repo:-}" -nemu_version="${nemu_version:-}" -nemu_ovmf_repo="${nemu_ovmf_repo:-}" -nemu_ovmf_version="${nemu_ovmf_version:-}" -kata_version="${kata_version:-}" - -if [ -z "$nemu_repo" ]; then - info "Get nemu information from runtime versions.yaml" - nemu_repo=$(get_from_kata_deps "assets.hypervisor.nemu.url" "$kata_version") -fi -[ -n "$nemu_repo" ] || die "failed to get nemu repo" - -[ -n "$nemu_version" ] || nemu_version=$(get_from_kata_deps "assets.hypervisor.nemu.version" "$kata_version") -[ -n "$nemu_version" ] || die "failed to get nemu version" - -if [ -z "$nemu_ovmf_repo" ]; then - info "Get nemu information from runtime versions.yaml" - nemu_ovmf_repo=$(get_from_kata_deps "assets.hypervisor.nemu-ovmf.url" "$kata_version") - [ -n "$nemu_ovmf_repo" ] || die "failed to get nemu ovmf repo url" -fi - -if [ -z "$nemu_ovmf_version" ]; then - nemu_ovmf_version=$(get_from_kata_deps "assets.hypervisor.nemu-ovmf.version" "$kata_version") - [ -n "$nemu_ovmf_version" ] || die "failed to get nemu ovmf version" -fi - -nemu_virtiofsd_binary="virtiofsd-x86_64" -nemu_virtiofsd_release="${nemu_repo}/releases/download/${nemu_version}" -nemu_ovmf_release="${nemu_ovmf_repo}/releases/download/${nemu_ovmf_version}/OVMF.fd" -info "Build ${nemu_repo} version: ${nemu_version}" - -http_proxy="${http_proxy:-}" -https_proxy="${https_proxy:-}" -prefix="${prefix:-"/opt/kata"}" - -sudo docker build \ - --no-cache \ - --build-arg http_proxy="${http_proxy}" \ - --build-arg https_proxy="${https_proxy}" \ - --build-arg NEMU_REPO="${nemu_repo}" \ - --build-arg NEMU_VERSION="${nemu_version}" \ - --build-arg NEMU_OVMF="${nemu_ovmf_release}" \ - --build-arg VIRTIOFSD_RELEASE="${nemu_virtiofsd_release}" \ - --build-arg VIRTIOFSD="${nemu_virtiofsd_binary}" \ - --build-arg PREFIX="${prefix}" \ - --build-arg DPKG_ARCH="${dpkg_arch}" \ - --build-arg GEN_ARCH="${arch}" \ - "${config_dir}" \ - -f "${script_dir}/$Dockerfile" \ - -t nemu-static - -sudo docker run \ - -i \ - -v "${PWD}":/share nemu-static \ - mv "/tmp/nemu-static/${nemu_tar}" /share/ - -sudo chown ${USER}:${USER} "${PWD}/${nemu_tar}" - -# Remove blacklisted binaries -gzip -d < "${nemu_tar}" | tar --delete --wildcards -f - ${qemu_black_list[*]} | gzip > "${nemu_tmp_tar}" -mv -f "${nemu_tmp_tar}" "${nemu_tar}"