From 9e3dab7d2e2f7e08baa65dfec78e27343608bdbd Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Tue, 8 Mar 2022 09:24:33 -0500 Subject: [PATCH] openstack-image-zfs: build a single-image ZFS root --- .../scripts/openstack/openstack-image-zfs.nix | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix b/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix index 714b24a9e046..b18b3265283f 100644 --- a/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix +++ b/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix @@ -48,15 +48,7 @@ in }; }; - system.build.openstackImage' = import ../../../lib/make-disk-image.nix { - inherit lib config copyChannel; - additionalSpace = "1024M"; - pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package - format = "qcow2"; - - }; - - system.build.openstackImage = import ../../../lib/make-zfs-image.nix { + system.build.openstackImage = import ../../../lib/make-single-disk-zfs-image.nix { inherit lib config; inherit (cfg) contents format name; pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package @@ -84,28 +76,21 @@ in extension=''${rootDiskImage##*.} friendlyName=$out/${cfg.name} rootDisk="$friendlyName.root.$extension" - bootDisk="$friendlyName.boot.$extension" mv "$rootDiskImage" "$rootDisk" - mv "$bootDiskImage" "$bootDisk" mkdir -p $out/nix-support - echo "file ${cfg.format} $bootDisk" >> $out/nix-support/hydra-build-products echo "file ${cfg.format} $rootDisk" >> $out/nix-support/hydra-build-products ${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 boot_mode "${imageBootMode}" \ --arg root "$rootDisk" \ - --arg boot "$bootDisk" \ '{} | .label = $system_label | .boot_mode = $boot_mode | .system = $system - | .disks.boot.logical_bytes = $boot_logical_bytes - | .disks.boot.file = $boot | .disks.root.logical_bytes = $root_logical_bytes | .disks.root.file = $root ' > $out/nix-support/image-info.json