Skip to content

Commit

Permalink
qemu: Improve cache build
Browse files Browse the repository at this point in the history
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 <jos.c.venegas.munoz@intel.com>
  • Loading branch information
jcvenegas committed Mar 23, 2021
1 parent bc587da commit b0e51e5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tools/packaging/static-build/qemu/Dockerfile
Expand Up @@ -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

Expand Down Expand Up @@ -55,15 +49,20 @@ 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

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"}') && \
Expand All @@ -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

0 comments on commit b0e51e5

Please sign in to comment.