qemu-vm: ensure we do not overwrite the partition table when EFI is in use

This commit is contained in:
Arthur Gautier 2022-09-05 17:10:59 -07:00
parent 24b025c615
commit 7f026cc6d0

View file

@ -858,7 +858,8 @@ in
# If the disk image appears to be empty, run mke2fs to
# initialise.
FSTYPE=$(blkid -o value -s TYPE ${cfg.bootDevice} || true)
if test -z "$FSTYPE"; then
PARTTYPE=$(blkid -o value -s PTTYPE ${cfg.bootDevice} || true)
if test -z "$FSTYPE" -a -z "$PARTTYPE"; then
mke2fs -t ext4 ${cfg.bootDevice}
fi
'';