diff options
author | Ryan Lahfa <masterancpp@gmail.com> | 2022-12-01 15:16:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-01 15:16:23 +0100 |
commit | a8a68c3427632c079667ee8aa37dc6666c6f71fb (patch) | |
tree | dddab3b0f10432d31ccfbf17d26804502c1a5498 /nixos/modules/virtualisation | |
parent | cc11eea79decd441d8413d97b3c539df4ed24333 (diff) | |
parent | 7f026cc6d02746d553e5e3701d44fc89869bc7af (diff) |
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
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r-- | nixos/modules/virtualisation/qemu-vm.nix | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index edc6dfdc15ae9..9af7e07ccfbab 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -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 ''; |