diff --git a/static-build/qemu/build-static-qemu.sh b/static-build/qemu/build-static-qemu.sh index 2e41592ede..1cbaf7d0aa 100755 --- a/static-build/qemu/build-static-qemu.sh +++ b/static-build/qemu/build-static-qemu.sh @@ -27,6 +27,9 @@ fi [ -n "$qemu_repo" ] || die "failed to get qemu repo" [ -n "$qemu_version" ] || qemu_version=$(get_from_kata_deps "assets.hypervisor.qemu.version") +if ! (git ls-remote --heads "${qemu_url}" | grep -q "refs/heads/${qemu_version}"); then + qemu_version=$(get_from_kata_deps "assets.hypervisor.qemu.tag") +fi [ -n "$qemu_version" ] || die "failed to get qemu version" info "Build ${qemu_repo} version: ${qemu_version}"