From 051181249ccc3845e2015ae1e97daf43eba68fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 12 Jul 2022 14:32:17 +0200 Subject: [PATCH] packaging: Add a "-" in the dir name if $BUILD_DIR is available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently $BUILD_DIR will be used to create a directory as: /opt/kata/share/kata-qemu${BUILD_DIR} It means that when passing a BUILD_DIR, like "foo", a name would be built like /opt/kata/share/kata-qemufoo We should, instead, be building it as /opt/kata/share/kata-qemu-foo. Fixes: #4638 Signed-off-by: Fabiano FidĂȘncio --- tools/packaging/static-build/qemu/Dockerfile | 6 ++++-- .../static-build/qemu/build-static-qemu-experimental.sh | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/packaging/static-build/qemu/Dockerfile b/tools/packaging/static-build/qemu/Dockerfile index 27d088303e..24d98fd0bb 100644 --- a/tools/packaging/static-build/qemu/Dockerfile +++ b/tools/packaging/static-build/qemu/Dockerfile @@ -72,8 +72,10 @@ 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" && \ - (PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s "kata-qemu${BUILD_SUFFIX}" | xargs ./configure \ - --with-pkgversion="kata-static${BUILD_SUFFIX}") && \ + [ -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})" && \ make install DESTDIR="${QEMU_DESTDIR}" && \ /root/static-build/scripts/qemu-build-post.sh diff --git a/tools/packaging/static-build/qemu/build-static-qemu-experimental.sh b/tools/packaging/static-build/qemu/build-static-qemu-experimental.sh index 12cc57f5aa..be50fb9770 100755 --- a/tools/packaging/static-build/qemu/build-static-qemu-experimental.sh +++ b/tools/packaging/static-build/qemu/build-static-qemu-experimental.sh @@ -26,4 +26,4 @@ fi [ -n "$qemu_version" ] || qemu_version=$(get_from_kata_deps "assets.hypervisor.qemu-experimental.version") [ -n "$qemu_version" ] || die "failed to get qemu version" -"${script_dir}/build-base-qemu.sh" "${qemu_repo}" "${qemu_version}" "-experimental" "kata-static-qemu-experimental.tar.gz" +"${script_dir}/build-base-qemu.sh" "${qemu_repo}" "${qemu_version}" "experimental" "kata-static-qemu-experimental.tar.gz"