From b0e51e59fa42cf5c3768b4ba2cf0bbf2a52dbb74 Mon Sep 17 00:00:00 2001 From: Carlos Venegas Date: Fri, 19 Mar 2021 16:51:34 +0000 Subject: [PATCH] qemu: Improve cache build Add arguments and files as needed, if only of them changes the build will start from the change and not from scratch. Signed-off-by: Carlos Venegas --- tools/packaging/static-build/qemu/Dockerfile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/packaging/static-build/qemu/Dockerfile b/tools/packaging/static-build/qemu/Dockerfile index 253b8b33f9..0165bcbc77 100644 --- a/tools/packaging/static-build/qemu/Dockerfile +++ b/tools/packaging/static-build/qemu/Dockerfile @@ -4,12 +4,6 @@ # SPDX-License-Identifier: Apache-2.0 from ubuntu:20.04 -ARG QEMU_DESTDIR -ARG QEMU_REPO -# commit/tag/branch -ARG QEMU_VERSION -ARG QEMU_TARBALL -ARG PREFIX WORKDIR /root/qemu @@ -55,7 +49,13 @@ RUN apt-get --no-install-recommends install -y \ rsync \ zlib1g-dev +ARG QEMU_REPO + RUN cd .. && git clone "${QEMU_REPO}" qemu + +# commit/tag/branch +ARG QEMU_VERSION + RUN git checkout "${QEMU_VERSION}" RUN git clone https://github.com/qemu/capstone.git capstone RUN git clone https://github.com/qemu/keycodemapdb.git ui/keycodemapdb @@ -63,7 +63,6 @@ RUN git clone https://github.com/qemu/keycodemapdb.git ui/keycodemapdb ADD scripts/configure-hypervisor.sh /root/configure-hypervisor.sh ADD qemu /root/kata_qemu ADD scripts/apply_patches.sh /root/apply_patches.sh -ADD static-build /root/static-build RUN echo "Apply patches for base version" RUN stable_branch=$(cat VERSION | awk 'BEGIN{FS=OFS="."}{print $1 "." $2 ".x"}') && \ @@ -72,10 +71,15 @@ RUN stable_branch=$(cat VERSION | awk 'BEGIN{FS=OFS="."}{print $1 "." $2 ".x"}') RUN echo "Apply patches for specific qemu version" RUN /root/apply_patches.sh "/root/kata_qemu/patches/tag_patches/${QEMU_VERSION}" +ARG PREFIX ARG BUILD_SUFFIX RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s "kata-qemu${BUILD_SUFFIX}" | xargs ./configure \ --with-pkgversion="kata-static${BUILD_SUFFIX}" RUN make -j$(nproc) +ARG QEMU_DESTDIR RUN make install DESTDIR="${QEMU_DESTDIR}" +ARG QEMU_TARBALL +ADD static-build/scripts/qemu-build-post.sh /root/static-build/scripts/qemu-build-post.sh +ADD static-build/qemu.blacklist /root/static-build/qemu.blacklist RUN /root/static-build/scripts/qemu-build-post.sh