From 67da4ef5c862576e046ab4d813de17628adfa6c4 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 20 Mar 2020 16:00:34 +0100 Subject: enable to repair encrypted LVMs/LUKS (mga#22795) - ask for encryption key - add enabled dmcrypts to the list of partitions to look at --- rescue/bin/guessmounts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'rescue/bin/guessmounts') diff --git a/rescue/bin/guessmounts b/rescue/bin/guessmounts index 55d18ef58..c5dc5996b 100755 --- a/rescue/bin/guessmounts +++ b/rescue/bin/guessmounts @@ -58,6 +58,22 @@ if (@$raid_parts) { push @$normal_parts, @$raids; } +# Basically doing fsedit::dmcrypts(): +(my $luks_parts, $normal_parts) = partition { isRawLUKS($_) } @$normal_parts; +if (@$luks_parts) { + use interactive; + use interactive::curses; + require diskdrake::interactive; + my $in = interactive->vnew('su'); + my $all_hds = fsedit::get_hds({}, $in); + # Unlocking them in order to look at their fs (do they hold a Mageia installation): + foreach my $part (@$luks_parts) { + diskdrake::interactive::dmcrypt_open($in, undef, $part, $all_hds) + } + my @dmcrypts = fs::dmcrypt::get_existing(@$luks_parts); + push @$normal_parts, @dmcrypts; +} + my @roots; my $arch = arch() =~ /i.86/ ? $MDK::Common::System::compat_arch{arch()} : arch(); -- cgit v1.2.1