summaryrefslogtreecommitdiffstats
path: root/scripts/ci/docker/setup_kvm.sh
blob: 1ffbbf50f61fc7dcdfedcdda764b3a66a28ca383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env bash

# This script makes the gid of the 'kvm' group to match the group
# owner of '/dev/kvm'
#
# These two are not guaranteed to match when a docker image starts
# with access to '/dev/kvm' that comes from the host

set -euo pipefail

kvm_gid=$(stat -c "%g" /dev/kvm)
groupmod -g "$kvm_gid" kvm
usermod -a -G kvm bitbake
ln -s /bin/true /usr/bin/kvm-ok