Backs up old sd card on copy.
This commit is contained in:
parent
64a572d846
commit
426fe7353a
27
flake.nix
27
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
|
||||
'';
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue