summary refs log tree commit diff
path: root/nixos/modules/installer/tools/nixos-generate-config.pl
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-05-08 21:02:40 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-05-09 00:51:48 +0200
commit4b7c606589be8440c982dc19bc9497b13e82abce (patch)
tree76623e0740c9bfd65375dde3353353ce0183d128 /nixos/modules/installer/tools/nixos-generate-config.pl
parentdc78ae327c5e20c5e24214c956be219fc8d213c2 (diff)
downloadnixpkgs-4b7c606589be8440c982dc19bc9497b13e82abce.tar
nixpkgs-4b7c606589be8440c982dc19bc9497b13e82abce.tar.gz
nixpkgs-4b7c606589be8440c982dc19bc9497b13e82abce.tar.bz2
nixpkgs-4b7c606589be8440c982dc19bc9497b13e82abce.tar.lz
nixpkgs-4b7c606589be8440c982dc19bc9497b13e82abce.tar.xz
nixpkgs-4b7c606589be8440c982dc19bc9497b13e82abce.tar.zst
nixpkgs-4b7c606589be8440c982dc19bc9497b13e82abce.zip
nixos-generator-config: Don't emit a double / in bind mounts
Diffstat (limited to 'nixos/modules/installer/tools/nixos-generate-config.pl')
-rw-r--r--nixos/modules/installer/tools/nixos-generate-config.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl
index d54539edfa3..ab058efc709 100644
--- a/nixos/modules/installer/tools/nixos-generate-config.pl
+++ b/nixos/modules/installer/tools/nixos-generate-config.pl
@@ -305,9 +305,11 @@ foreach my $fs (read_file("/proc/self/mountinfo")) {
     # Maybe this is a bind-mount of a filesystem we saw earlier?
     if (defined $fsByDev{$fields[2]}) {
         my $path = $fields[3]; $path = "" if $path eq "/";
+        my $base = $fsByDev{$fields[2]};
+        $base = "" if $base eq "/";
         $fileSystems .= <<EOF;
   fileSystems.\"$mountPoint\" =
-    { device = \"$fsByDev{$fields[2]}$path\";
+    { device = \"$base$path\";
       fsType = \"none\";
       options = \"bind\";
     };