diff options
Diffstat (limited to 'nixos/lib')
-rw-r--r-- | nixos/lib/make-disk-image.nix | 3 | ||||
-rw-r--r-- | nixos/lib/make-iso9660-image.nix | 6 | ||||
-rw-r--r-- | nixos/lib/make-iso9660-image.sh | 9 | ||||
-rw-r--r-- | nixos/lib/test-driver/test-driver.py | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index 5e86ea479d51..9364aab32770 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -39,7 +39,7 @@ , name ? "nixos-disk-image" -, # Disk image format, one of qcow2, qcow2-compressed, vpc, raw. +, # Disk image format, one of qcow2, qcow2-compressed, vdi, vpc, raw. format ? "raw" }: @@ -57,6 +57,7 @@ let format' = format; in let filename = "nixos." + { qcow2 = "qcow2"; + vdi = "vdi"; vpc = "vhd"; raw = "img"; }.${format}; diff --git a/nixos/lib/make-iso9660-image.nix b/nixos/lib/make-iso9660-image.nix index 0f3f2b5b5234..12a6cf649966 100644 --- a/nixos/lib/make-iso9660-image.nix +++ b/nixos/lib/make-iso9660-image.nix @@ -34,8 +34,8 @@ , # The path (outside the ISO file system) of the isohybrid-mbr image. isohybridMbrImage ? "" -, # Whether to compress the resulting ISO image with bzip2. - compressImage ? false +, # Whether to compress the resulting ISO image with zstd. + compressImage ? false, zstd , # The volume ID. volumeID ? "" @@ -48,7 +48,7 @@ assert usbBootable -> isohybridMbrImage != ""; stdenv.mkDerivation { name = isoName; builder = ./make-iso9660-image.sh; - buildInputs = [ xorriso syslinux ]; + buildInputs = [ xorriso syslinux zstd ]; inherit isoName bootable bootImage compressImage volumeID efiBootImage efiBootable isohybridMbrImage usbBootable; diff --git a/nixos/lib/make-iso9660-image.sh b/nixos/lib/make-iso9660-image.sh index d4633d2c8d16..d64fe9a365e7 100644 --- a/nixos/lib/make-iso9660-image.sh +++ b/nixos/lib/make-iso9660-image.sh @@ -129,9 +129,14 @@ fi if test -n "$compressImage"; then echo "Compressing image..." - bzip2 $out/iso/$isoName + zstd -T$NIX_BUILD_CORES --rm $out/iso/$isoName fi mkdir -p $out/nix-support echo $system > $out/nix-support/system -echo "file iso $out/iso/$isoName" >> $out/nix-support/hydra-build-products + +if test -n "$compressImage"; then + echo "file iso $out/iso/$isoName.zst" >> $out/nix-support/hydra-build-products +else + echo "file iso $out/iso/$isoName" >> $out/nix-support/hydra-build-products +fi diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index bf46d0df97f9..e7b05968b079 100644 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -598,11 +598,8 @@ class Machine: shutil.copytree(host_src, host_intermediate) else: shutil.copy(host_src, host_intermediate) - self.succeed("sync") self.succeed(make_command(["mkdir", "-p", vm_target.parent])) self.succeed(make_command(["cp", "-r", vm_intermediate, vm_target])) - # Make sure the cleanup is synced into VM - self.succeed("sync") def copy_from_vm(self, source: str, target_dir: str = "") -> None: """Copy a file from the VM (specified by an in-VM source path) to a path @@ -620,7 +617,6 @@ class Machine: # Copy the file to the shared directory inside VM self.succeed(make_command(["mkdir", "-p", vm_shared_temp])) self.succeed(make_command(["cp", "-r", vm_src, vm_intermediate])) - self.succeed("sync") abs_target = out_dir / target_dir / vm_src.name abs_target.parent.mkdir(exist_ok=True, parents=True) # Copy the file from the shared directory outside VM @@ -628,8 +624,6 @@ class Machine: shutil.copytree(intermediate, abs_target) else: shutil.copy(intermediate, abs_target) - # Make sure the cleanup is synced into VM - self.succeed("sync") def dump_tty_contents(self, tty: str) -> None: """Debugging: Dump the contents of the TTY<n> |