summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-04-19 17:17:13 +0000
committerThierry Vignaud <tv@mageia.org>2013-04-19 17:17:13 +0000
commit327665c753f616babee751a013645f64a83c3f80 (patch)
tree8f4aed319cf6ec442319682744aa8868c020b977 /perl-install/diskdrake
parenta0a2b0e1819a65000a7efd68072ecb72dd8356ae (diff)
downloaddrakx-327665c753f616babee751a013645f64a83c3f80.tar
drakx-327665c753f616babee751a013645f64a83c3f80.tar.gz
drakx-327665c753f616babee751a013645f64a83c3f80.tar.bz2
drakx-327665c753f616babee751a013645f64a83c3f80.tar.xz
drakx-327665c753f616babee751a013645f64a83c3f80.zip
fix losing crypt key when activating inactive partitions (mga#5661)
Diffstat (limited to 'perl-install/diskdrake')
-rw-r--r--perl-install/diskdrake/interactive.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 8a4d9bb9c..b1d6809cc 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -954,8 +954,18 @@ sub dmcrypt_open {
delete $part->{dmcrypt_key};
die(($? >> 8) == 255 ? N("Invalid key") : $@);
}
- # Detect LVMs on top of dmcrypt
+ detect_lvms_on_dmcrypt($all_hds);
+}
+
+# Detect LVMs on top of dmcrypt
+sub detect_lvms_on_dmcrypt {
+ my ($all_hds) = @_,
+ require File::Temp;
+ my (undef, $tmp_file) = File::Temp::mkstemp('/tmp/crypttab.XXXXXXX');
+ fs::dmcrypt::save_crypttab_($all_hds, $tmp_file);
$all_hds->{lvms} = [ fsedit::lvms($all_hds) ];
+ fs::dmcrypt::read_crypttab_($all_hds, $tmp_file);
+ rm_rf($tmp_file);
}
sub Add2RAID {