From 4744e3b3be39bf2ef249d991a720846cefd51b46 Mon Sep 17 00:00:00 2001 From: catvayor Date: Mon, 7 Oct 2024 14:22:09 +0200 Subject: [PATCH] test! test! feat(qemu-nand): script to launch with nand --- default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index e372095..1070930 100644 --- a/default.nix +++ b/default.nix @@ -52,7 +52,7 @@ let borderVmConf ]; }).config.system; -in { +in rec { inherit evalModules; outputs = config.system.outputs // { @@ -90,4 +90,16 @@ in { lua ]; }; + + try-nand = pkgs.pkgsBuildBuild.writeShellScriptBin "try-nand.sh" '' + rootfs=$(mktemp) + cp ${outputs.default}/rootfs $rootfs + ${pkgs.pkgsBuildBuild.qemuLim}/bin/qemu-system-mips \ + -M malta -echr 16 -m 272 \ + -device nand,chip_id=0x59,id=nand -drive format=raw,file=''${rootfs},if=mtd,id=nand \ + -serial mon:stdio -kernel ${outputs.default}/vmlinux \ + -append "root=/dev/mtdblock0 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 root=/dev/mtdblock0 rootfstype=squashfs fw_devlink=off mem=256M liminix mtdparts=phram0:16M(rootfs) phram.phram=phram0,0x90000000,16Mi,65536" \ + -display none + rm $rootfs + ''; }