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

View File

@@ -449,7 +449,11 @@ EOF
if (-e $slave) {
my $dmName = read_file("/sys/class/block/$deviceName/dm/name");
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";
}
}
}
}