summaryrefslogtreecommitdiffstats
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
commite4bc73e0d75a2e67fedf4db20f169b5e6406b9d0 (patch)
tree4122759d02c4b8ffec81c2a3dea0fb78b93fa445
parent3928e119899ee844bc0ac90e963d913782b8ae9c (diff)
downloaddrakx-e4bc73e0d75a2e67fedf4db20f169b5e6406b9d0.tar
drakx-e4bc73e0d75a2e67fedf4db20f169b5e6406b9d0.tar.gz
drakx-e4bc73e0d75a2e67fedf4db20f169b5e6406b9d0.tar.bz2
drakx-e4bc73e0d75a2e67fedf4db20f169b5e6406b9d0.tar.xz
drakx-e4bc73e0d75a2e67fedf4db20f169b5e6406b9d0.zip
offer to pick the distro to rescue when there's more than one
-rw-r--r--rescue/NEWS1
-rwxr-xr-xrescue/guessmounts16
2 files changed, 16 insertions, 1 deletions
diff --git a/rescue/NEWS b/rescue/NEWS
index aeb6346aa..0722c5328 100644
--- a/rescue/NEWS
+++ b/rescue/NEWS
@@ -2,6 +2,7 @@
- drop our "use modprobe instead" insmod since we've kmod one for free
- include libdevmapper-event-*.so
- include persistant storage udev rules needed to see new uuids
+- offer to pick the distro to rescue when there's more than one
- /var/run/utmp is on tmpfs now
Version 1.40 - 6 March 2013 by Thierry Vignaud
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}};