summaryrefslogtreecommitdiffstats
path: root/rescue/guessmounts
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-04-06 04:55:24 +0000
committerThierry Vignaud <tv@mageia.org>2013-04-06 04:55:24 +0000
commit26ed5623d48ed5096e1928a04fd0655671777d3a (patch)
tree4122759d02c4b8ffec81c2a3dea0fb78b93fa445 /rescue/guessmounts
parent254bdb9006af77aab0cf54683f99f7b574b4a308 (diff)
downloaddrakx-backup-do-not-use-26ed5623d48ed5096e1928a04fd0655671777d3a.tar
drakx-backup-do-not-use-26ed5623d48ed5096e1928a04fd0655671777d3a.tar.gz
drakx-backup-do-not-use-26ed5623d48ed5096e1928a04fd0655671777d3a.tar.bz2
drakx-backup-do-not-use-26ed5623d48ed5096e1928a04fd0655671777d3a.tar.xz
drakx-backup-do-not-use-26ed5623d48ed5096e1928a04fd0655671777d3a.zip
offer to pick the distro to rescue when there's more than one
Diffstat (limited to 'rescue/guessmounts')
-rwxr-xr-xrescue/guessmounts16
1 files changed, 15 insertions, 1 deletions
diff --git a/rescue/guessmounts b/rescue/guessmounts
index 67ef6c536..9b592f07e 100755
--- a/rescue/guessmounts
+++ b/rescue/guessmounts
@@ -85,7 +85,21 @@ if (@roots) {
@roots = sort { $b->{version} cmp $a->{version} } @roots;
# Then pick mga over mdv:
@roots = map { @$_ } partition { $_->{release} =~ /Mageia/ } @roots;
- my $selected = first(@roots);
+
+ my $selected;
+ if (@roots == 1) {
+ $selected = first(@roots);
+ } else {
+ print "\n\nWhich system do you want to rescue?\n";
+ each_index { print $::i + 1, ": $_->{pretty_name}\n" } @roots;
+ my $res;
+ while ($res < 1 || $res > @roots) {
+ print "what is your choice (type the number of your selection or C^c to abort)?\n";
+ $res = <>;
+ }
+ $selected = $roots[$res-1];
+ }
+
$root = $selected->{dev};
$fs = $selected->{fs};
@fstab = @{$selected->{fstab}};