From 60b72659610ce0520af521ab7dd0afca40a449c6 Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Wed, 23 Sep 2020 13:55:24 -0400 Subject: [PATCH] static-build/qemu-virtiofs: Refactor apply virtiofs patches In static-build/qemu-virtiofs/Dockerfile the code which applies the virtiofs specific patches is spread in several RUN instructions. Refactor this code so that it runs in a single RUN and produce a single overlay image. Signed-off-by: Wainer dos Santos Moschetta --- tools/packaging/static-build/qemu-virtiofs/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/packaging/static-build/qemu-virtiofs/Dockerfile b/tools/packaging/static-build/qemu-virtiofs/Dockerfile index d916a1140..89c3e1abf 100644 --- a/tools/packaging/static-build/qemu-virtiofs/Dockerfile +++ b/tools/packaging/static-build/qemu-virtiofs/Dockerfile @@ -54,10 +54,11 @@ ADD qemu /root/kata_qemu # Apply experimental specific patches # Patches to quick fix virtiofs fork ENV VIRTIOFS_PATCHES_DIR=/root/kata_qemu/patches/${QEMU_VIRTIOFS_TAG}/ -RUN find "${VIRTIOFS_PATCHES_DIR}" -name '*.patch' -type f |sort -t- -k1,1n > patches_virtiofs -RUN echo "Patches to apply for virtiofs fixes:" -RUN cat patches_virtiofs -RUN [ ! -s patches_virtiofs ] || git apply $(cat patches_virtiofs) +RUN if [ -d ${VIRTIOFS_PATCHES_DIR} ]; then \ + echo "Patches to apply for virtiofs fixes:"; \ + for patch in $(find "${VIRTIOFS_PATCHES_DIR}" -name '*.patch' -type f |sort -t- -k1,1n); do \ + git apply $patch; \ + done;fi RUN /root/kata_qemu/apply_patches.sh RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s kata-qemu | sed -e 's|--disable-seccomp||g' | xargs ./configure \