qemu: clean stale clone before fetching sources

build-qemu.sh runs in the per-target builddir (e.g.
build/qemu-tarball/builddir/), which persists across runs. If a previous
build left the cloned `qemu` tree behind (e.g. after an interrupted
build), the next run errors out with:

  fatal: destination path 'qemu' already exists and is not an empty
  directory.

Wipe `qemu` before cloning so the build is repeatable from a dirty
builddir.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
Assisted-By: Claude <noreply@anthropic.com>
This commit is contained in:
Zvonko Kaiser
2026-05-07 19:06:57 +00:00
committed by Fabiano Fidêncio
parent 18cee00df9
commit 3be370d2d6

View File

@@ -27,6 +27,7 @@ kata_static_build_scripts="${kata_static_build_dir}/scripts"
ARCH=${ARCH:-$(uname -m)}
rm -rf qemu
git clone --depth=1 "${QEMU_REPO}" qemu
pushd qemu
git fetch --depth=1 origin "${QEMU_VERSION_NUM}"