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:
Eelco Dolstra 2013-10-11 17:24:30 +02:00
parent 984921e657
commit 57804f44ec

View File

@ -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
}