0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

bcachefs: 2023-06-28 -> 2023-09-29

Includes prep work for mainline bcachefs release.
This commit is contained in:
Daniel Hill 2023-09-23 15:34:38 +12:00 committed by Jörg Thalheim
parent 6c1a24a6ea
commit d6bf8b47ec
9 changed files with 351 additions and 46 deletions

View file

@ -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\" =