summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rescue/NEWS1
-rwxr-xr-xrescue/guessmounts17
2 files changed, 12 insertions, 6 deletions
diff --git a/rescue/NEWS b/rescue/NEWS
index fdd1fc67f..83b15a55d 100644
--- a/rescue/NEWS
+++ b/rescue/NEWS
@@ -1,4 +1,5 @@
- add missing libfuse.so.2 for mount.ntfs-3g (#1189)
+- prefer Mageia root partitions over Mdv ones (#1320)
Version 1.24 - 20 May 2011, by tmb
diff --git a/rescue/guessmounts b/rescue/guessmounts
index 37e2249a1..f8e4b02da 100755
--- a/rescue/guessmounts
+++ b/rescue/guessmounts
@@ -51,7 +51,7 @@ if (@$raid_parts) {
}
my @fstab;
-my $root;
+my ($root, @roots);
foreach (@$normal_parts) {
my $dev = devices::make($_->{device});
@@ -61,14 +61,19 @@ foreach (@$normal_parts) {
} fs::type::true_local_fs_types() or next;
if (my $release_file = common::release_file($target)) {
+ my $release = chomp_(cat_("$target$release_file"));
print STDERR "=> found a %s root partition on $dev\n=> type $fs, version `",
- chomp_(cat_("$target$release_file")), "'\n";
+ $release, "'\n";
@fstab = fs::read_fstab($target, '/etc/fstab');
- $root = $dev;
- last;
- } else {
- system('umount', $target) == 0 or die "error unmounting $target\n";
+ push @roots, { dev => $dev, release => $release };
}
+ system('umount', $target) == 0 or die "error unmounting $target\n";
+}
+
+# Try Mageia first:
+if (@roots) {
+ @roots = map { @$_ } partition { $_->{release} =~ /Mageia/ } @roots;
+ $root = first(@roots)->{dev};
}
if ($root) {