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]}) { if (defined $fsByDev{$fields[2]}) {
my $path = $fields[3]; $path = "" if $path eq "/"; my $path = $fields[3]; $path = "" if $path eq "/";
$fileSystems .= <<EOF; $fileSystems .= <<EOF;
fileSystems.\"$mountPoint\" = { fileSystems.\"$mountPoint\" =
device = \"$fsByDev{$fields[2]}$path\"; { device = \"$fsByDev{$fields[2]}$path\";
fsType = \"none\"; fsType = \"none\";
options = \"bind\"; options = \"bind\";
}; };
EOF EOF
next; 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? # Is this a mount of a loopback device?
my @extraOptions; my @extraOptions;
@ -271,13 +278,12 @@ EOF
} }
# Emit the filesystem. # Emit the filesystem.
$fsByDev{$fields[2]} = $mountPoint;
$fileSystems .= <<EOF; $fileSystems .= <<EOF;
fileSystems.\"$mountPoint\" = { fileSystems.\"$mountPoint\" =
device = \"$device\"; { device = \"$device\";
fsType = \"$fsType\"; fsType = \"$fsType\";
options = \"${\join ",", uniq(@extraOptions, @superOptions, @mountOptions)}\"; options = \"${\join ",", uniq(@extraOptions, @superOptions, @mountOptions)}\";
}; };
EOF EOF
} }