diff options
author | Luke Granger-Brown <git@lukegb.com> | 2024-03-17 16:58:04 +0000 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2024-03-26 23:32:09 +0100 |
commit | 3b8cd8ad708f72f237daf05b42a956184bf2996d (patch) | |
tree | 5d5960c5dd1de4b88c982a5e27d789d5ed63aa09 /nixos/modules/installer | |
parent | c77e28a0137b288ed46550d8940301b2f79903c0 (diff) |
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.
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 2f9edba4f0c9c..ef25b8b296e6e 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -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"; } |