mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-11 07:15:54 +03:00
installer/nixos-generate-config: correctly detect bcache
PR #256638 inadvertently introduced a bug in `nixos-generate-config` whereby it would never put `bcache` into the `availableKernelModules` for the initrd. This is because the `qr` operator in Perl returns a regex object, rather than matching it; the regex object evaluates to true, making the filter expression effectively `grep(!true, @bcacheDevices)`, which will always return an empty list.
This commit is contained in:
parent
c77e28a013
commit
3b8cd8ad70
@ -257,7 +257,7 @@ foreach my $path (glob "/sys/class/{block,mmc_host}/*") {
|
||||
|
||||
# Add bcache module, if needed.
|
||||
my @bcacheDevices = glob("/dev/bcache*");
|
||||
@bcacheDevices = grep(!qr#dev/bcachefs.*#, @bcacheDevices);
|
||||
@bcacheDevices = grep(!m#dev/bcachefs.*#, @bcacheDevices);
|
||||
if (scalar @bcacheDevices > 0) {
|
||||
push @initrdAvailableKernelModules, "bcache";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user