diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2017-10-07 03:31:59 +0200 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2017-10-07 04:04:20 +0200 |
commit | 801c920e95642ec663d4aa486c81e5443e25b182 (patch) | |
tree | c3a94edd2a99004cbdfb23e5a2b8d96b4323ed5c /nixos/modules/installer/tools | |
parent | c559e96445412e25db8d9b26e4c7237da15fb9e6 (diff) | |
download | nixlib-801c920e95642ec663d4aa486c81e5443e25b182.tar nixlib-801c920e95642ec663d4aa486c81e5443e25b182.tar.gz nixlib-801c920e95642ec663d4aa486c81e5443e25b182.tar.bz2 nixlib-801c920e95642ec663d4aa486c81e5443e25b182.tar.lz nixlib-801c920e95642ec663d4aa486c81e5443e25b182.tar.xz nixlib-801c920e95642ec663d4aa486c81e5443e25b182.tar.zst nixlib-801c920e95642ec663d4aa486c81e5443e25b182.zip |
btrfs-progs: 4.8.2 -> 4.13.1
Diffstat (limited to 'nixos/modules/installer/tools')
-rw-r--r-- | nixos/modules/installer/tools/nixos-generate-config.pl | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 4ec48b773358..97a30634dc7e 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -398,19 +398,15 @@ EOF # Is this a btrfs filesystem? if ($fsType eq "btrfs") { - my ($status, @id_info) = runCommand("btrfs subvol show $rootDir$mountPoint"); - if ($status != 0 || join("", @id_info) =~ /ERROR:/) { + my ($status, @info) = runCommand("btrfs subvol show $rootDir$mountPoint"); + if ($status != 0 || join("", @info) =~ /ERROR:/) { die "Failed to retrieve subvolume info for $mountPoint\n"; } - my @ids = join("", @id_info) =~ m/Subvolume ID:[ \t\n]*([^ \t\n]*)/; + my @ids = join("", @info) =~ m/Subvolume ID:[ \t\n]*([0-9]*)/; if ($#ids > 0) { die "Btrfs subvol name for $mountPoint listed multiple times in mount\n" } elsif ($#ids == 0) { - my ($status, @path_info) = runCommand("btrfs subvol list $rootDir$mountPoint"); - if ($status != 0) { - die "Failed to find $mountPoint subvolume id from btrfs\n"; - } - my @paths = join("", @path_info) =~ m/ID $ids[0] [^\n]* path ([^\n]*)/; + my @paths = join("", @info) =~ m/^([^\n]*)/; if ($#paths > 0) { die "Btrfs returned multiple paths for a single subvolume id, mountpoint $mountPoint\n"; } elsif ($#paths != 0) { |