From 426fe7353a84d842e33c34f7bbfd9b5294d12b5b Mon Sep 17 00:00:00 2001 From: Bailey Stevens Date: Tue, 4 Apr 2023 15:40:16 -0400 Subject: [PATCH] Backs up old sd card on copy. --- flake.nix | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index f7b0803..e516a88 100644 --- a/flake.nix +++ b/flake.nix @@ -24,19 +24,20 @@ uncompressed = import ./sd-card.nix { inherit pkgs crossPkgs; compress = false; }; vmscript = pkgs.writeScriptBin "vmscript" '' - #!${pkgs.runtimeShell} - img=./sd-card.img - cp ${self.outputs.packages.${system}.uncompressed}/sd-card.img $img - chmod 640 $img - ${pkgs.qemu}/bin/qemu-system-aarch64 \ - -machine raspi3b \ - -kernel "${crossPkgs.ubootRaspberryPi3_64bit}/u-boot.bin" \ - -cpu max \ - -m 1G \ - -smp 4 \ - -drive file="$img",format=raw \ - -serial null \ - -serial mon:stdio + #!${pkgs.runtimeShell} -e + img=./sd-card.img + cp -b ${self.outputs.packages.${system}.uncompressed}/sd-card.img $img + chmod 640 $img + ${pkgs.qemu}/bin/qemu-system-aarch64 \ + -machine raspi3b \ + -kernel "${crossPkgs.ubootRaspberryPi3_64bit}/u-boot.bin" \ + -cpu max \ + -m 1G \ + -smp 4 \ + -drive file="$img",format=raw \ + -nographic \ + -serial null \ + -serial mon:stdio ''; };