diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2019-06-10 21:12:01 +0200 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2019-06-10 21:22:07 +0200 |
commit | 4755811a12c11b5ed6f6ccd6036526d5869d9b17 (patch) | |
tree | 44fb2a2ba9e6ee5f1d7dd14ab3c1c1912843475b /nixos/modules/installer | |
parent | c58b5f6f4bc5ef11b2581e851aca63773a429db6 (diff) |
nixos-generate-config: add support for bcache
Add "bcache" to boot.initrd.availableKernelModules if a bcache device is
detected.
This fixes a problem I've had one too many times: I install NixOS and
forget to add "bcache", resulting in an unbootable machine (until fixed
with Live CD). Now NixOS will do it for me.
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index b7e5b99a9e0..0ccdac30d91 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -258,6 +258,11 @@ foreach my $path (glob "/sys/class/{block,mmc_host}/*") { } } +# Add bcache module, if needed. +my @bcacheDevices = glob("/dev/bcache*"); +if (scalar @bcacheDevices > 0) { + push @initrdAvailableKernelModules, "bcache"; +} my $virt = `systemd-detect-virt`; chomp $virt; |