From d29427d353958ca66a1cf365ff78e1c4dad280ec Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Thu, 4 Jul 2019 14:43:03 -0500 Subject: [PATCH] qemu: static: Apply qemu patches depending on the verison. qemu static is using all the patches that we have for qemu, we only want to apply depending the version. Fixes: #619 Signed-off-by: Jose Carlos Venegas Munoz --- static-build/qemu/Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static-build/qemu/Dockerfile b/static-build/qemu/Dockerfile index 34ab29805f..410a17e2c3 100644 --- a/static-build/qemu/Dockerfile +++ b/static-build/qemu/Dockerfile @@ -39,9 +39,15 @@ 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/patches/* /root/kata_qemu_patches +ADD qemu/patches/ /root/kata_qemu_patches -RUN for patch in /root/kata_qemu_patches/*.patch; do git apply "$patch"; done +RUN \ + cat VERSION; \ + stable_branch=$(cat VERSION | awk 'BEGIN{FS=OFS="."}{print $1 "." $2 ".x"}');\ + for patch in $(find /root/kata_qemu_patches/${stable_branch}/ -name '*.patch'); do\ + echo "apply $patch";\ + git apply "$patch"; \ + done RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s kata-qemu | xargs ./configure \ --with-pkgversion=kata-static