From 7bb1a3906da7c77e8ad7fbb3327016ecb539297f Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 10 Jun 2024 15:54:09 +0300 Subject: [PATCH] BuildSystem: Run kvm-ok to determine kvm access --- README.md | 2 +- script/build.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6bc4e8e4..375add1f 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Each major component and library has its own subdirectory (kernel, userspace, li ### Needed packages #### apt (tested on ubuntu 22.04) -```# apt install build-essential git ninja-build texinfo bison flex libgmp-dev libmpfr-dev libmpc-dev parted qemu-system-x86``` +```# apt install build-essential git ninja-build texinfo bison flex libgmp-dev libmpfr-dev libmpc-dev parted qemu-system-x86 cpu-checker``` #### pacman ```# pacman -S --needed base-devel git wget cmake ninja parted qemu-system-x86``` diff --git a/script/build.sh b/script/build.sh index eb0c2ad2..23144d28 100755 --- a/script/build.sh +++ b/script/build.sh @@ -60,7 +60,11 @@ run_bochs () { $BANAN_SCRIPT_DIR/bochs.sh $@ } -if [[ -c /dev/kvm ]]; then +if type kvm-ok &> /dev/null; then + if kvm-ok &> /dev/null; then + QEMU_ACCEL="-accel kvm" + fi +elif [[ -c /dev/kvm ]]; then if [[ -r /dev/kvm ]] && [[ -w /dev/kvm ]]; then QEMU_ACCEL="-accel kvm" else