diff options
Diffstat (limited to 'rescue/guessmounts')
-rwxr-xr-x | rescue/guessmounts | 17 |
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) { |