diff options
author | Thierry Vignaud <tv@mageia.org> | 2011-08-05 19:43:19 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2011-08-05 19:43:19 +0000 |
commit | 903232fb042093673cd812d99d44406176fdf48d (patch) | |
tree | 650e40fb8fdaa899c6883ffc427542d461466add /rescue | |
parent | bc6a1012f128d0ec402e7eaf0b93dfa3a01817b5 (diff) | |
download | drakx-903232fb042093673cd812d99d44406176fdf48d.tar drakx-903232fb042093673cd812d99d44406176fdf48d.tar.gz drakx-903232fb042093673cd812d99d44406176fdf48d.tar.bz2 drakx-903232fb042093673cd812d99d44406176fdf48d.tar.xz drakx-903232fb042093673cd812d99d44406176fdf48d.zip |
prefer Mageia root partitions over Mdv ones (#1320)
Diffstat (limited to 'rescue')
-rw-r--r-- | rescue/NEWS | 1 | ||||
-rwxr-xr-x | rescue/guessmounts | 17 |
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) { |