Backs up old sd card on copy.

This commit is contained in:
Bailey Stevens 2023-04-04 15:40:16 -04:00
parent 64a572d846
commit 426fe7353a

View file

@ -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
'';
};