summaryrefslogtreecommitdiffstats
path: root/rescue/guessmounts
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2011-08-05 19:43:19 +0000
committerThierry Vignaud <tv@mageia.org>2011-08-05 19:43:19 +0000
commita614cea25c55f70cb61e6ac5ebf9eaea283058ab (patch)
tree650e40fb8fdaa899c6883ffc427542d461466add /rescue/guessmounts
parentecf8afa64dcc8e9576504dea4504f028b4b27583 (diff)
downloaddrakx-backup-do-not-use-a614cea25c55f70cb61e6ac5ebf9eaea283058ab.tar
drakx-backup-do-not-use-a614cea25c55f70cb61e6ac5ebf9eaea283058ab.tar.gz
drakx-backup-do-not-use-a614cea25c55f70cb61e6ac5ebf9eaea283058ab.tar.bz2
drakx-backup-do-not-use-a614cea25c55f70cb61e6ac5ebf9eaea283058ab.tar.xz
drakx-backup-do-not-use-a614cea25c55f70cb61e6ac5ebf9eaea283058ab.zip
prefer Mageia root partitions over Mdv ones (#1320)
Diffstat (limited to 'rescue/guessmounts')
-rwxr-xr-xrescue/guessmounts17
1 files changed, 11 insertions, 6 deletions
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) {