Skip to content

Commit

Permalink
Merge pull request #850 from mr-nice/docker-kvm
Browse files Browse the repository at this point in the history
envsetup.sh: docker: only use /dev/kvm if available
  • Loading branch information
kraj authored Oct 5, 2023
2 parents c211775 + cc5eba5 commit 91f8aab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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"
}
Expand Down

0 comments on commit 91f8aab

Please sign in to comment.