diff options
| author | Arthur Gautier <arthur.gautier@arista.com> | 2022-09-05 17:10:59 -0700 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2022-12-01 14:23:35 +0000 |
| commit | d0869156a7fe5f81b33bd3d6b76821e42d6bbdfd (patch) | |
| tree | 4006bef96f6cac3187e543506bfcac07605d5723 | |
| parent | nixos: disable systemd-oomd when enableUnifiedCgroupHierarchy is false (diff) | |
| download | nixpkgs-origin/backport-189935-to-release-22.11.tar.gz | |
qemu-vm: ensure we do not overwrite the partition table when EFI is in useorigin/backport-189935-to-release-22.11
(cherry picked from commit 7f026cc6d02746d553e5e3701d44fc89869bc7af)
| -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 edc6dfdc15ae..9af7e07ccfba 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 ''; |
