diff options
author | Ryan Lahfa <masterancpp@gmail.com> | 2023-05-15 13:24:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 13:24:08 +0200 |
commit | 5a7e90bc95a9d6202e68719391d13535b977d38a (patch) | |
tree | 0214bfabde4a3a3fc4ff70b5b6506bb678c08f0b /nixos | |
parent | ca043941b96a45558f514b125ca7234cb37a7566 (diff) | |
parent | f9d741912f30cb0819eb426dca03125b54260bc7 (diff) |
Merge pull request #228801 from NixOS/make-disk-image-faster
nixos/lib/make-disk-image: do not compile a full arch QEMU to convert images
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/lib/make-disk-image.nix | 2 | ||||
-rw-r--r-- | nixos/lib/make-multi-disk-zfs-image.nix | 4 | ||||
-rw-r--r-- | nixos/lib/make-single-disk-zfs-image.nix | 2 | ||||
-rw-r--r-- | nixos/maintainers/scripts/ec2/amazon-image.nix | 6 | ||||
-rw-r--r-- | nixos/maintainers/scripts/openstack/openstack-image-zfs.nix | 2 | ||||
-rw-r--r-- | nixos/tests/systemd-repart.nix | 2 |
6 files changed, 9 insertions, 9 deletions
diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index db53bb98ee4ef..33d834e36b44e 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -511,7 +511,7 @@ let format' = format; in let ${if format == "raw" then '' mv $diskImage $out/${filename} '' else '' - ${pkgs.qemu}/bin/qemu-img convert -f raw -O ${format} ${compress} $diskImage $out/${filename} + ${pkgs.qemu-utils}/bin/qemu-img convert -f raw -O ${format} ${compress} $diskImage $out/${filename} ''} diskImage=$out/${filename} ''; diff --git a/nixos/lib/make-multi-disk-zfs-image.nix b/nixos/lib/make-multi-disk-zfs-image.nix index ecbde44971a99..077bb8f227075 100644 --- a/nixos/lib/make-multi-disk-zfs-image.nix +++ b/nixos/lib/make-multi-disk-zfs-image.nix @@ -261,8 +261,8 @@ let mv $bootDiskImage $out/${bootFilename} mv $rootDiskImage $out/${rootFilename} '' else '' - ${pkgs.qemu}/bin/qemu-img convert -f raw -O ${formatOpt} ${compress} $bootDiskImage $out/${bootFilename} - ${pkgs.qemu}/bin/qemu-img convert -f raw -O ${formatOpt} ${compress} $rootDiskImage $out/${rootFilename} + ${pkgs.qemu_kvm}/bin/qemu-img convert -f raw -O ${formatOpt} ${compress} $bootDiskImage $out/${bootFilename} + ${pkgs.qemu_kvm}/bin/qemu-img convert -f raw -O ${formatOpt} ${compress} $rootDiskImage $out/${rootFilename} ''} bootDiskImage=$out/${bootFilename} rootDiskImage=$out/${rootFilename} diff --git a/nixos/lib/make-single-disk-zfs-image.nix b/nixos/lib/make-single-disk-zfs-image.nix index ef3b1c0e2842d..a3564f9a8b68e 100644 --- a/nixos/lib/make-single-disk-zfs-image.nix +++ b/nixos/lib/make-single-disk-zfs-image.nix @@ -244,7 +244,7 @@ let ${if formatOpt == "raw" then '' mv $rootDiskImage $out/${rootFilename} '' else '' - ${pkgs.qemu}/bin/qemu-img convert -f raw -O ${formatOpt} ${compress} $rootDiskImage $out/${rootFilename} + ${pkgs.qemu_kvm}/bin/qemu-img convert -f raw -O ${formatOpt} ${compress} $rootDiskImage $out/${rootFilename} ''} rootDiskImage=$out/${rootFilename} set -x diff --git a/nixos/maintainers/scripts/ec2/amazon-image.nix b/nixos/maintainers/scripts/ec2/amazon-image.nix index 0db0f4d0dcca4..6f6bab8dc3d66 100644 --- a/nixos/maintainers/scripts/ec2/amazon-image.nix +++ b/nixos/maintainers/scripts/ec2/amazon-image.nix @@ -102,8 +102,8 @@ in { ${pkgs.jq}/bin/jq -n \ --arg system_label ${lib.escapeShellArg config.system.nixos.label} \ --arg system ${lib.escapeShellArg pkgs.stdenv.hostPlatform.system} \ - --arg root_logical_bytes "$(${pkgs.qemu}/bin/qemu-img info --output json "$rootDisk" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ - --arg boot_logical_bytes "$(${pkgs.qemu}/bin/qemu-img info --output json "$bootDisk" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ + --arg root_logical_bytes "$(${pkgs.qemu_kvm}/bin/qemu-img info --output json "$rootDisk" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ + --arg boot_logical_bytes "$(${pkgs.qemu_kvm}/bin/qemu-img info --output json "$bootDisk" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ --arg boot_mode "${amiBootMode}" \ --arg root "$rootDisk" \ --arg boot "$bootDisk" \ @@ -142,7 +142,7 @@ in { ${pkgs.jq}/bin/jq -n \ --arg system_label ${lib.escapeShellArg config.system.nixos.label} \ --arg system ${lib.escapeShellArg pkgs.stdenv.hostPlatform.system} \ - --arg logical_bytes "$(${pkgs.qemu}/bin/qemu-img info --output json "$diskImage" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ + --arg logical_bytes "$(${pkgs.qemu_kvm}/bin/qemu-img info --output json "$diskImage" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ --arg boot_mode "${amiBootMode}" \ --arg file "$diskImage" \ '{} diff --git a/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix b/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix index f73e251d30469..936dcee12949e 100644 --- a/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix +++ b/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix @@ -85,7 +85,7 @@ in ${pkgs.jq}/bin/jq -n \ --arg system_label ${lib.escapeShellArg config.system.nixos.label} \ --arg system ${lib.escapeShellArg pkgs.stdenv.hostPlatform.system} \ - --arg root_logical_bytes "$(${pkgs.qemu}/bin/qemu-img info --output json "$rootDisk" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ + --arg root_logical_bytes "$(${pkgs.qemu_kvm}/bin/qemu-img info --output json "$rootDisk" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ --arg boot_mode "${imageBootMode}" \ --arg root "$rootDisk" \ '{} diff --git a/nixos/tests/systemd-repart.nix b/nixos/tests/systemd-repart.nix index 36de5d988fdb1..b1d19c2b7cc1d 100644 --- a/nixos/tests/systemd-repart.nix +++ b/nixos/tests/systemd-repart.nix @@ -21,7 +21,7 @@ let shutil.copyfile("${machine.system.build.diskImage}/nixos.img", tmp_disk_image.name) subprocess.run([ - "${pkgs.qemu}/bin/qemu-img", + "${machine.config.virtualisation.qemu.package}/bin/qemu-img", "resize", "-f", "raw", |