diff options
author | Daniel Hill <daniel@gluo.nz> | 2023-09-23 15:34:38 +1200 |
---|---|---|
committer | Jörg Thalheim <Mic92@users.noreply.github.com> | 2023-10-03 22:00:26 +0100 |
commit | d6bf8b47ece5ed435cc0e66725fc7afe0ee1550b (patch) | |
tree | 87723c28aaead00514601bd2098240b870d1d341 /nixos/modules/installer | |
parent | 6c1a24a6eaf0df82c06f2e5925dbf09fcf3d59c3 (diff) |
bcachefs: 2023-06-28 -> 2023-09-29
Includes prep work for mainline bcachefs release.
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 7d0c5898e23df..064d01d05c0cc 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -273,6 +273,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); if (scalar @bcacheDevices > 0) { push @initrdAvailableKernelModules, "bcache"; } @@ -483,6 +484,19 @@ EOF # boot.tmp.useTmpfs option in configuration.nix (managed declaratively). next if ($mountPoint eq "/tmp" && $fsType eq "tmpfs"); + # This should work for single and multi-device systems. + # still needs subvolume support + if ($fsType eq "bcachefs") { + my ($status, @info) = runCommand("bcachefs fs usage $rootDir$mountPoint"); + my $UUID = $info[0]; + + if ($status == 0 && $UUID =~ /^Filesystem:[ \t\n]*([0-9a-z-]+)/) { + $stableDevPath = "UUID=$1"; + } else { + print STDERR "warning: can't find bcachefs mount UUID falling back to device-path"; + } + } + # Emit the filesystem. $fileSystems .= <<EOF; fileSystems.\"$mountPoint\" = |