Merge pull request #189935 from baloo/baloo/qemu-vm/fixup-efi-partitions

qemu-vm: ensure we do not overwrite the partition table when EFI is in use
This commit is contained in:
Ryan Lahfa 2022-12-01 15:16:23 +01:00 committed by GitHub
commit a8a68c3427
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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