From d5265ef4c16f784311c1d0803aa5c4d4631b9bfc Mon Sep 17 00:00:00 2001 From: Malte Voos Date: Thu, 4 Apr 2024 21:20:17 +0200 Subject: enable KVM for BLAZING FAST performance on a raspberry pi --- flake.nix | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/flake.nix b/flake.nix index 2a92482..837cb0b 100644 --- a/flake.nix +++ b/flake.nix @@ -59,17 +59,6 @@ installFlags = [ "DESTDIR=${placeholder "out"}" ]; }; - ext4Rootfs = pkgs.runCommand "rm-rootfs.ext4" - { - nativeBuildInputs = with pkgs; [ - (python3.withPackages (pypkgs: [ pypkgs.protobuf ])) - qemu - libguestfs-with-appliance - ]; - } '' - python3 ${ddvk-stuff}/extractor/extractor.py ${updateArchive} $out - ''; - rootfs = pkgs.runCommand "rm-rootfs.qcow2" { nativeBuildInputs = with pkgs; [ @@ -125,13 +114,7 @@ EOF ''; - kernel = pkgs.pkgsCross.armv7l-hf-multiplatform.linux_5_4.override { - # structuredExtraConfig = with pkgs.lib.kernel; { - # PCI = yes; - # VIRTIO_PCI = yes; - # PCI_HOST_GENERIC = yes; - # }; - }; + kernel = pkgs.pkgsCross.armv7l-hf-multiplatform.linux_5_4; server = pkgs.writeShellApplication { name = "reMder-server"; @@ -141,9 +124,10 @@ text = '' qemu-img create -b ${rootfs} -F qcow2 -f qcow2 ./reMder.qcow2 - # TODO switch to pci virtio devices? (uncomment kernel config above) - qemu-system-arm \ + qemu-system-aarch64 \ + -enable-kvm \ -machine virt \ + -cpu host,aarch64=off \ -m 2048 \ -kernel ${kernel}/zImage \ -drive if=none,file=./reMder.qcow2,format=qcow2,id=hd \ @@ -193,7 +177,7 @@ in { packages = { - inherit reMder fakefbdev ext4Rootfs; + inherit reMder fakefbdev; }; defaultPackage = reMder; -- cgit 1.4.1