summaryrefslogtreecommitdiffstats
path: root/rescue/bin/guessmounts
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2020-03-20 16:00:34 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2020-03-20 16:08:29 +0100
commit67da4ef5c862576e046ab4d813de17628adfa6c4 (patch)
tree17c8cf51b5d8ea293989075a63d0e25b34cc19e7 /rescue/bin/guessmounts
parente8a3f0871c8d79a8522f17cae9d6f212596cf94a (diff)
downloaddrakx-67da4ef5c862576e046ab4d813de17628adfa6c4.tar
drakx-67da4ef5c862576e046ab4d813de17628adfa6c4.tar.gz
drakx-67da4ef5c862576e046ab4d813de17628adfa6c4.tar.bz2
drakx-67da4ef5c862576e046ab4d813de17628adfa6c4.tar.xz
drakx-67da4ef5c862576e046ab4d813de17628adfa6c4.zip
enable to repair encrypted LVMs/LUKS (mga#22795)
- ask for encryption key - add enabled dmcrypts to the list of partitions to look at
Diffstat (limited to 'rescue/bin/guessmounts')
-rwxr-xr-xrescue/bin/guessmounts16
1 files changed, 16 insertions, 0 deletions
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();