diff options
Diffstat (limited to 'server.nix')
| -rw-r--r-- | server.nix | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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 \ |