From cc5eba5c3e37eb8c472f93ecd4826bd109ea2d9b Mon Sep 17 00:00:00 2001 From: Bernhard Guillon Date: Wed, 4 Oct 2023 20:49:34 +0200 Subject: [PATCH] envsetup.sh: docker: only use /dev/kvm if available --- envsetup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/envsetup.sh b/envsetup.sh index 0804cf177..cf4a3d3cf 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -602,6 +602,12 @@ dkr() { " fi + if [ -f /dev/kvm ]; then + DOCKER_ENABLE_KVM="--device /dev/kvm" + else + DOCKER_ENABLE_KVM="" + fi + $DOCKER run --rm -i $PSEUDO_TTY \ -v ${OE_BASE}:${OE_BASE} \ -v ~/.ssh:/home/build/.ssh \ @@ -621,7 +627,7 @@ dkr() { $DOCKER_EXTRA_ARGS \ --cap-add=NET_ADMIN \ --device /dev/net/tun \ - --device /dev/kvm \ + ${DOCKER_ENABLE_KVM} \ --device /dev/vhost-net \ ${DOCKER_REPO} /bin/bash -c "$CMD" }