feat(systemd-repart): build image

This commit is contained in:
Lars Sjöström 2025-02-24 16:13:43 +01:00
parent e7470498e5
commit af78f1c930
No known key found for this signature in database
5 changed files with 82 additions and 18 deletions

View file

@ -19,7 +19,7 @@ pkgs.writeShellApplication {
state="/tmp/patos-qemu-$USER"
rm -rf "$state"
mkdir -m 700 "$state"
truncate -s 1G "$state/disk.raw"
qemu-img create -f qcow2 -F raw -b "$(readlink -e "$1")" "$state/disk.qcow2" 2G
swtpm socket -d --tpmstate dir="$state" \
--ctrl type=unixio,path="$state/swtpm-sock" \
@ -44,7 +44,6 @@ pkgs.writeShellApplication {
-device tpm-tis,tpmdev=tpm0 \
-netdev id=net00,type=user,hostfwd=tcp::2222-:22 \
-device virtio-net-pci,netdev=net00 \
-drive "file=fat:rw:patos/,format=raw" \
-drive "format=raw,file=$state/disk.raw"
-drive "format=qcow2,file=$state/disk.qcow2"
'';
}