nixos/btrfs: use algorithm names instead of kernel module names

The canonical names of kernel crypto modules are not stable across
versions. Use the algorithm names from btrfs softdeps instead, which
the kernel will resolve to the appropriate modules.
Previously: xxhash_generic, blake2b_generic, sha256_generic
Now: xxhash64, blake2b-256, sha256
This fixes initrd builds on kernel 6.19+ where blake2b_generic was
renamed to blake2b, and is more resilient to future module renames.
See: https://github.com/torvalds/linux/blob/v6.19-rc1/fs/btrfs/super.c#L2705-L2708
This commit is contained in:
okt
2025-12-23 11:04:04 -07:00
parent 334f6835da
commit cbd09c66a5
+4 -5
View File
@@ -89,12 +89,11 @@ in
"crc32c"
]
++ optionals (config.boot.kernelPackages.kernel.kernelAtLeast "5.5") [
# Needed for mounting filesystems with new checksums
"xxhash_generic"
"blake2b_generic"
# `sha256` is always available, whereas `sha256_generic` is not available from 6.17 onwards
# The canonical names of these modules are not very stable, so use the algorithm names that the btrfs module expects.
# See: https://github.com/torvalds/linux/blob/v6.19-rc1/fs/btrfs/super.c#L2705-L2708
"xxhash64"
"sha256" # Should be baked into our kernel, just to be sure
"blake2b-256"
];
boot.initrd.extraUtilsCommands = mkIf (!config.boot.initrd.systemd.enable) ''