summary refs log tree commit diff
path: root/nixos/modules/system/boot
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2014-05-02 03:37:50 -0500
committerWilliam A. Kennington III <william@wkennington.com>2014-08-28 13:35:36 -0700
commit0f6079d999e3922782f3ce6daf742f32568118ac (patch)
treeb3920348499a3e5215c9c9c2ffe113e0a67e13d5 /nixos/modules/system/boot
parentcc62623b37c4ac6e17968b36d9ced8bbf28fb883 (diff)
downloadnixlib-0f6079d999e3922782f3ce6daf742f32568118ac.tar
nixlib-0f6079d999e3922782f3ce6daf742f32568118ac.tar.gz
nixlib-0f6079d999e3922782f3ce6daf742f32568118ac.tar.bz2
nixlib-0f6079d999e3922782f3ce6daf742f32568118ac.tar.lz
nixlib-0f6079d999e3922782f3ce6daf742f32568118ac.tar.xz
nixlib-0f6079d999e3922782f3ce6daf742f32568118ac.tar.zst
nixlib-0f6079d999e3922782f3ce6daf742f32568118ac.zip
nixos/grub: Fix spacing and correct subvolume detection
Diffstat (limited to 'nixos/modules/system/boot')
-rw-r--r--nixos/modules/system/boot/loader/grub/install-grub.pl16
1 files changed, 8 insertions, 8 deletions
diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl
index 3c84fccac34c..acfb85f3bc5c 100644
--- a/nixos/modules/system/boot/loader/grub/install-grub.pl
+++ b/nixos/modules/system/boot/loader/grub/install-grub.pl
@@ -72,10 +72,10 @@ struct(Fs => {
 });
 sub GetFs {
     my ($dir) = @_;
-	my ($status, @dfOut) = runCommand("df -T $dir");
-	if ($status != 0 || $#dfOut != 1) {
-		die "Failed to retrieve output about $dir from `df`";
-	}
+    my ($status, @dfOut) = runCommand("df -T $dir");
+    if ($status != 0 || $#dfOut != 1) {
+        die "Failed to retrieve output about $dir from `df`";
+    }
     my @boot = split(/[ \n\t]+/, $dfOut[1]);
     return Fs->new(device => $boot[0], type => $boot[1], mount => $boot[6]);
 }
@@ -133,16 +133,16 @@ sub GrubFs {
 
             # BTRFS is a special case in that we need to fix the referrenced path based on subvolumes
             if ($fs->type eq 'btrfs') {
-                my ($status, @info) = runCommand("btrfs subvol show @{[$fs->device]}");
+                my ($status, @info) = runCommand("btrfs subvol show @{[$fs->mount]}");
                 if ($status != 0) {
-                    die "Failed to retreive subvolume info for @{[$fs->device]}";
+                    die "Failed to retreive subvolume info for @{[$fs->mount]}";
                 }
                 my @subvols = join("", @info) =~ m/Name:[ \t\n]*([^ \t\n]*)/;
                 if ($#subvols > 0) {
                     die "Btrfs subvol name for @{[$fs->device]} listed multiple times in mount\n"
                 } elsif ($#subvols == 0) {
-	                $path = "/$subvols[0]$path";
-				}
+                    $path = "/$subvols[0]$path";
+                }
             }
         }
         if (not $search eq "") {