ci: wait for udev to apply the KVM rule, print what the runner has

This commit is contained in:
theupriser committed 2026-09-30 10:07:50 +02:00
1 parent c4631d6a23
commit 0bbe97214e
1 file changed
+5 -2
+5 -2
View File
@@ -11,8 +11,11 @@ runs:
shell: bash shell: bash
run: | run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules && sudo udevadm trigger --name-match=kvm sudo udevadm control --reload-rules && sudo udevadm trigger --name-match=kvm && sudo udevadm settle || true
[ -w /dev/kvm ] || { echo "::error::no usable /dev/kvm on this runner"; exit 1; } for _ in $(seq 10); do [ -w /dev/kvm ] && break; sleep 1; done
ls -l /dev/kvm 2>&1 || true
grep -cE 'vmx|svm' /proc/cpuinfo || true
[ -w /dev/kvm ] || { echo "::error::no usable /dev/kvm on this runner (some GitHub runners have none: re-run the job)"; exit 1; }
sudo apt-get update -qq sudo apt-get update -qq
sudo apt-get install -y -qq qemu-system-x86 qemu-utils ovmf libarchive-tools openssh-client sudo apt-get install -y -qq qemu-system-x86 qemu-utils ovmf libarchive-tools openssh-client
# The VMs and the ISO on /mnt (the big disk); ~/vms points there. # The VMs and the ISO on /mnt (the big disk); ~/vms points there.