mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 03:25:02 +00:00
41b56b4b8a
f2fs.fsck depends on crc32 module being present in the initrd system, otherwise, if f2fs is used as the root disk, the system is unbootable.
20 lines
452 B
Nix
20 lines
452 B
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
inInitrd = any (fs: fs == "f2fs") config.boot.initrd.supportedFilesystems;
|
|
in
|
|
{
|
|
config = mkIf (any (fs: fs == "f2fs") config.boot.supportedFilesystems) {
|
|
|
|
system.fsPackages = [ pkgs.f2fs-tools ];
|
|
|
|
boot.initrd.availableKernelModules = mkIf inInitrd [ "f2fs" "crc32" ];
|
|
|
|
boot.initrd.extraUtilsCommands = mkIf inInitrd ''
|
|
copy_bin_and_libs ${pkgs.f2fs-tools}/sbin/fsck.f2fs
|
|
'';
|
|
};
|
|
}
|