From 54d6d01754b689a32da852cfd85a69d2c4730baa Mon Sep 17 00:00:00 2001 From: Ryan Savino Date: Thu, 1 Sep 2022 20:36:28 -0500 Subject: [PATCH 1/2] qemu: fix tdx qemu tarball directories Dockerfile cannot decipher multiple conditional statements in the main RUN call. Cannot segregate statements in Dockerfile with '{}' braces without wrapping entire statement in 'bash -c' statement. Dockerfile does not support setting variables by bash command. Must set HYPERVISOR_NAME and PKGVERSION from parent script: build-base-qemu.sh Fixes: #5078 Signed-Off-By: Ryan Savino --- tools/packaging/static-build/qemu/Dockerfile | 5 ++--- tools/packaging/static-build/qemu/build-base-qemu.sh | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/packaging/static-build/qemu/Dockerfile b/tools/packaging/static-build/qemu/Dockerfile index 51b5960477..b06c345504 100644 --- a/tools/packaging/static-build/qemu/Dockerfile +++ b/tools/packaging/static-build/qemu/Dockerfile @@ -56,7 +56,8 @@ ARG QEMU_REPO # commit/tag/branch ARG QEMU_VERSION ARG PREFIX -ARG BUILD_SUFFIX +ARG HYPERVISOR_NAME +ARG PKGVERSION ARG QEMU_DESTDIR ARG QEMU_TARBALL @@ -78,8 +79,6 @@ RUN git clone --depth=1 "${QEMU_REPO}" qemu && \ git fetch --depth=1 origin "${QEMU_VERSION}" && git checkout FETCH_HEAD && \ scripts/git-submodule.sh update meson capstone && \ /root/patch_qemu.sh "${QEMU_VERSION}" "/root/kata_qemu/patches" && \ - [ -n "${BUILD_SUFFIX}" ] && HYPERVISOR_NAME="kata-qemu-${BUILD_SUFFIX}" || HYPERVISOR_NAME="kata-qemu" && \ - [ -n "${BUILD_SUFFIX}" ] && PKGVERSION="kata-static-${BUILD_SUFFIX}" || PKGVERSION="kata-static" && \ (PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s "${HYPERVISOR_NAME}" | xargs ./configure \ --with-pkgversion="${PKGVERSION}") && \ make -j"$(nproc ${CI:+--ignore 1})" && \ diff --git a/tools/packaging/static-build/qemu/build-base-qemu.sh b/tools/packaging/static-build/qemu/build-base-qemu.sh index a16285cd00..7d95f02332 100755 --- a/tools/packaging/static-build/qemu/build-base-qemu.sh +++ b/tools/packaging/static-build/qemu/build-base-qemu.sh @@ -34,9 +34,13 @@ prefix="${prefix:-"/opt/kata"}" CACHE_TIMEOUT=$(date +"%Y-%m-%d") +[ -n "${build_suffix}" ] && HYPERVISOR_NAME="kata-qemu-${build_suffix}" || HYPERVISOR_NAME="kata-qemu" +[ -n "${build_suffix}" ] && PKGVERSION="kata-static-${build_suffix}" || PKGVERSION="kata-static" + sudo "${container_engine}" build \ --build-arg CACHE_TIMEOUT="${CACHE_TIMEOUT}" \ - --build-arg BUILD_SUFFIX="${build_suffix}" \ + --build-arg HYPERVISOR_NAME="${HYPERVISOR_NAME}" \ + --build-arg PKGVERSION="${PKGVERSION}" \ --build-arg http_proxy="${http_proxy}" \ --build-arg https_proxy="${https_proxy}" \ --build-arg QEMU_DESTDIR="${qemu_destdir}" \ From 59e3850bfd02ae497673119871f0a9954b75d685 Mon Sep 17 00:00:00 2001 From: Ryan Savino Date: Thu, 1 Sep 2022 21:07:30 -0500 Subject: [PATCH 2/2] qemu: create no_patches.txt file for SPR-BKC-QEMU-v2.5 Patches failing without the no_patches.txt file for SPR-BKC-QEMU-v2.5. Signed-Off-By: Ryan Savino --- .../qemu/patches/tag_patches/SPR-BKC-QEMU-v2.5/no_patches.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tools/packaging/qemu/patches/tag_patches/SPR-BKC-QEMU-v2.5/no_patches.txt diff --git a/tools/packaging/qemu/patches/tag_patches/SPR-BKC-QEMU-v2.5/no_patches.txt b/tools/packaging/qemu/patches/tag_patches/SPR-BKC-QEMU-v2.5/no_patches.txt new file mode 100644 index 0000000000..e69de29bb2