nixos/btrfs: Fix parsing of btrfs subvolume show with btrfsprogs 4.1

This commit is contained in:
William A. Kennington III 2015-07-07 11:34:50 -07:00
parent b028c14256
commit 08ff83eab3
2 changed files with 2 additions and 2 deletions

View File

@ -354,7 +354,7 @@ EOF
if ($status != 0 || join("", @msg) =~ /ERROR:/) { if ($status != 0 || join("", @msg) =~ /ERROR:/) {
die "Failed to retrieve subvolume info for $mountPoint\n"; die "Failed to retrieve subvolume info for $mountPoint\n";
} }
my @ids = join("", @id_info) =~ m/Object ID:[ \t\n]*([^ \t\n]*)/; my @ids = join("", @id_info) =~ m/Subvolume ID:[ \t\n]*([^ \t\n]*)/;
if ($#ids > 0) { if ($#ids > 0) {
die "Btrfs subvol name for $mountPoint listed multiple times in mount\n" die "Btrfs subvol name for $mountPoint listed multiple times in mount\n"
} elsif ($#ids == 0) { } elsif ($#ids == 0) {

View File

@ -186,7 +186,7 @@ sub GrubFs {
if ($status != 0) { if ($status != 0) {
die "Failed to retrieve subvolume info for @{[$fs->mount]}\n"; die "Failed to retrieve subvolume info for @{[$fs->mount]}\n";
} }
my @ids = join("", @id_info) =~ m/Object ID:[ \t\n]*([^ \t\n]*)/; my @ids = join("", @id_info) =~ m/Subvolume ID:[ \t\n]*([^ \t\n]*)/;
if ($#ids > 0) { if ($#ids > 0) {
die "Btrfs subvol name for @{[$fs->device]} listed multiple times in mount\n" die "Btrfs subvol name for @{[$fs->device]} listed multiple times in mount\n"
} elsif ($#ids == 0) { } elsif ($#ids == 0) {