3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #54339 from avdv/avoid-duplicate-luks-device

installer/tools: Avoid duplicate LUKS device entries in hw config
This commit is contained in:
Silvan Mosberger 2019-01-22 15:23:09 +01:00 committed by GitHub
commit 115cf2e2cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -449,7 +449,11 @@ EOF
if (-e $slave) { if (-e $slave) {
my $dmName = read_file("/sys/class/block/$deviceName/dm/name"); my $dmName = read_file("/sys/class/block/$deviceName/dm/name");
chomp $dmName; chomp $dmName;
$fileSystems .= " boot.initrd.luks.devices.\"$dmName\".device = \"${\(findStableDevPath $slave)}\";\n\n"; # Ensure to add an entry only once
my $luksDevice = " boot.initrd.luks.devices.\"$dmName\".device";
if ($fileSystems !~ /^\Q$luksDevice\E/m) {
$fileSystems .= "$luksDevice = \"${\(findStableDevPath $slave)}\";\n\n";
}
} }
} }
} }