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.
This commit is contained in:
parent
c58b5f6f4b
commit
4755811a12
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue