mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-11 07:15:54 +03:00
nixos-generate-config: Skip FUSE filesystems
I don't know how to recover that a FUSE filesystem is (say) ntfs-3g.
This commit is contained in:
parent
984921e657
commit
57804f44ec
@ -248,15 +248,22 @@ foreach my $fs (read_file("/proc/self/mountinfo")) {
|
||||
if (defined $fsByDev{$fields[2]}) {
|
||||
my $path = $fields[3]; $path = "" if $path eq "/";
|
||||
$fileSystems .= <<EOF;
|
||||
fileSystems.\"$mountPoint\" = {
|
||||
device = \"$fsByDev{$fields[2]}$path\";
|
||||
fsType = \"none\";
|
||||
options = \"bind\";
|
||||
};
|
||||
fileSystems.\"$mountPoint\" =
|
||||
{ device = \"$fsByDev{$fields[2]}$path\";
|
||||
fsType = \"none\";
|
||||
options = \"bind\";
|
||||
};
|
||||
|
||||
EOF
|
||||
next;
|
||||
}
|
||||
$fsByDev{$fields[2]} = $mountPoint;
|
||||
|
||||
# We don't know how to handle FUSE filesystems.
|
||||
if ($fsType eq "fuseblk" || $fsType eq "fuse") {
|
||||
print STDERR "warning: don't know how to emit ‘fileSystem’ option for FUSE filesystem ‘$mountPoint’\n";
|
||||
next;
|
||||
}
|
||||
|
||||
# Is this a mount of a loopback device?
|
||||
my @extraOptions;
|
||||
@ -271,13 +278,12 @@ EOF
|
||||
}
|
||||
|
||||
# Emit the filesystem.
|
||||
$fsByDev{$fields[2]} = $mountPoint;
|
||||
$fileSystems .= <<EOF;
|
||||
fileSystems.\"$mountPoint\" = {
|
||||
device = \"$device\";
|
||||
fsType = \"$fsType\";
|
||||
options = \"${\join ",", uniq(@extraOptions, @superOptions, @mountOptions)}\";
|
||||
};
|
||||
fileSystems.\"$mountPoint\" =
|
||||
{ device = \"$device\";
|
||||
fsType = \"$fsType\";
|
||||
options = \"${\join ",", uniq(@extraOptions, @superOptions, @mountOptions)}\";
|
||||
};
|
||||
|
||||
EOF
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user