aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalte Voos <git@mal.tc>2026-10-13 12:43:24 +0200
committerMalte Voos <git@mal.tc>2026-10-13 12:43:24 +0200
commit2b423e82a420cafd406e32334fffa61ad0ef8555 (patch)
treebe737a55e5bcc5b2d20e54ed2c33d279e97aa321
parent64c1fd77c5d8d99607a00b151a71a1fee2d1b0c3 (diff)
downloadreMder-main.tar.gz
reMder-main.zip
opportunistic KVM accelHEADmain
-rw-r--r--server.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/server.nix b/server.nix
index 78f9e29..f4aeb82 100644
--- a/server.nix
+++ b/server.nix
@@ -134,11 +134,17 @@ writeShellApplication {
runtimeInputs = [ qemu ];
text = ''
- rm -f ./reMder.qcow2
- qemu-img create -b ${diskImage} -F qcow2 -f qcow2 ./reMder.qcow2
+ # check if we're on an aarch64 system with support for aarch32 at EL1
+ if echo quit | qemu-system-aarch64 -machine virt -accel kvm -cpu host,aarch64=off \
+ -display none -nodefaults -S -monitor stdio >/dev/null 2>&1; then
+ qemu="qemu-system-aarch64"
+ accel_opts=(-accel kvm -cpu "host,aarch64=off")
+ else
+ qemu="qemu-system-arm"
+ accel_opts=()
+ fi
- qemu-system-arm \
- -machine virt \
+ exec "$qemu" -machine virt "''${accel_opts[@]}" \
-m 2048 \
-kernel ${kernel}/zImage \
-snapshot \