summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtemu <atemu.main@gmail.com>2021-06-08 06:23:27 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2021-07-06 14:00:40 +0000
commit95fc4eb09de428094f60694aef4b54e21a025402 (patch)
tree36ee1f6253eba9a19b9dcf18f03d104a8ccec439
parentpython2Packages.certifi: init at 2019.11.28 (diff)
downloadnixpkgs-origin/backport-126158-to-release-21.05.tar.gz
nixos/btrfs: handle new checksum types in initrdorigin/backport-126158-to-release-21.05
Can't mount a root formatted with those otherwise (cherry picked from commit e85f2f43bda6e0fe245005b710091f854a7f0200)
-rw-r--r--nixos/modules/tasks/filesystems/btrfs.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/tasks/filesystems/btrfs.nix b/nixos/modules/tasks/filesystems/btrfs.nix
index c0ff28039b16..ae1dab5b8d8d 100644
--- a/nixos/modules/tasks/filesystems/btrfs.nix
+++ b/nixos/modules/tasks/filesystems/btrfs.nix
@@ -55,7 +55,16 @@ in
(mkIf enableBtrfs {
system.fsPackages = [ pkgs.btrfs-progs ];
- boot.initrd.kernelModules = mkIf inInitrd [ "btrfs" "crc32c" ];
+ boot.initrd.kernelModules = mkIf inInitrd [ "btrfs" ];
+ boot.initrd.availableKernelModules = mkIf inInitrd (
+ [ "crc32c" ]
+ ++ optionals (config.boot.kernelPackages.kernel.kernelAtLeast "5.5") [
+ # Needed for mounting filesystems with new checksums
+ "xxhash_generic"
+ "blake2b_generic"
+ "sha256_generic" # Should be baked into our kernel, just to be sure
+ ]
+ );
boot.initrd.extraUtilsCommands = mkIf inInitrd
''