installer: only use squashfs threads=multi on supported kernels

The `threads` SquashFS mount option was introduced in Linux 6.2 [1].
Since we still support older kernels and external users of nixpkgs
may reuse the ISO installer modules, this option should be guarded
by a kernel version check.

[1] https://www.kernelconfig.io/config_squashfs_choice_decomp_by_mount?arch=x86&kernelversion=6.10.10
This commit is contained in:
Josh Hoffer 2024-09-18 16:20:26 -07:00
parent 25b6a05d81
commit 6295433b2b
2 changed files with 2 additions and 2 deletions

View File

@ -722,7 +722,7 @@ in
"/nix/.ro-store" = lib.mkImageMediaOverride
{ fsType = "squashfs";
device = "/iso/nix-store.squashfs";
options = [ "loop" "threads=multi" ];
options = [ "loop" ] ++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi";
neededForBoot = true;
};

View File

@ -47,7 +47,7 @@ with lib;
fileSystems."/nix/.ro-store" = mkImageMediaOverride
{ fsType = "squashfs";
device = "../nix-store.squashfs";
options = [ "loop" "threads=multi" ];
options = [ "loop" ] ++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi";
neededForBoot = true;
};