Merge pull request #1791 from wizeman/u/nixos-gen

nixos-generate-config: improve filesystem generation
This commit is contained in:
Vladimír Čunát 2014-03-02 11:27:43 +01:00
commit d9cc648d6c

View File

@ -256,7 +256,7 @@ foreach my $fs (read_file("/proc/self/mountinfo")) {
$mountPoint = "/" if $mountPoint eq ""; $mountPoint = "/" if $mountPoint eq "";
# Skip special filesystems. # Skip special filesystems.
next if in($mountPoint, "/proc") || in($mountPoint, "/dev") || in($mountPoint, "/sys") || in($mountPoint, "/run"); next if in($mountPoint, "/proc") || in($mountPoint, "/dev") || in($mountPoint, "/sys") || in($mountPoint, "/run") || $mountPoint eq "/var/lib/nfs/rpc_pipefs";
# Skip the optional fields. # Skip the optional fields.
my $n = 6; $n++ while $fields[$n] ne "-"; $n++; my $n = 6; $n++ while $fields[$n] ne "-"; $n++;
@ -305,7 +305,15 @@ EOF
fileSystems.\"$mountPoint\" = fileSystems.\"$mountPoint\" =
{ device = \"$device\"; { device = \"$device\";
fsType = \"$fsType\"; fsType = \"$fsType\";
options = \"${\join ",", uniq(@extraOptions, @superOptions, @mountOptions)}\"; EOF
if (scalar @extraOptions > 0) {
$fileSystems .= <<EOF;
options = \"${\join ",", uniq(@extraOptions)}\";
EOF
}
$fileSystems .= <<EOF;
}; };
EOF EOF