mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 20:55:31 +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
1 changed files with 17 additions and 11 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue