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/NEWS | 1 + rescue/bin/guessmounts | 16 ++++++++++++++++ rescue/list.xml | 14 ++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/rescue/NEWS b/rescue/NEWS index 27349137b..5e4910f9c 100644 --- a/rescue/NEWS +++ b/rescue/NEWS @@ -2,6 +2,7 @@ o preset keyboard if DEBUG_INSTALL_LANG is set during build - do not preload all fs modules uselessly - guessmount: + o enable to repair encrypted LVMs/LUKS (mga#22795) o fix displaying the version of the distro o just use the fs reported by blkid instead of doing brute force guessing 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(); diff --git a/rescue/list.xml b/rescue/list.xml index 63d045624..a5746d192 100644 --- a/rescue/list.xml +++ b/rescue/list.xml @@ -215,6 +215,7 @@ Exporter.pm File/Path.pm File/Basename.pm + File/Temp.pm XSLoader.pm Symbol.pm SelectSaver.pm @@ -235,11 +236,16 @@ Encode/Unicode.pm auto/Encode/Unicode/Unicode.so DynaLoader.pm + File/Spec.pm + File/Spec/Unix.pm auto/IO/IO.so auto/Socket/Socket.so Errno.pm IO/Socket/INET.pm IO/Socket/UNIX.pm + List/Util.pm + auto/List/Util/Util.so + Scalar/Util.pm @@ -248,6 +254,11 @@ + + perl-Curses + perl-Curses-UI + + mke2fs.conf netconfig @@ -430,6 +441,9 @@ + interactive.pm + interactive/curses.pm + diskdrake/interactive.pm fs/dmraid.pm fs/remote.pm fs/remote/davfs.pm -- cgit v1.2.1