Discussion:
[2810] fix mounting / (mga#3327)
root-odJJhXpcy38dnm+
2012-01-25 18:30:30 UTC
Permalink
Revision: 2810
Author: tv
Date: 2012-01-25 19:30:29 +0100 (Wed, 25 Jan 2012)
Log Message:
-----------
fix mounting / (mga#3327)

Modified Paths:
--------------
drakx/trunk/rescue/NEWS
drakx/trunk/rescue/guessmounts

Modified: drakx/trunk/rescue/NEWS
===================================================================
--- drakx/trunk/rescue/NEWS 2012-01-25 18:30:25 UTC (rev 2809)
+++ drakx/trunk/rescue/NEWS 2012-01-25 18:30:29 UTC (rev 2810)
@@ -1,4 +1,5 @@
- enable rescue through serial line (mga#2052)
+- fix mounting / (mga#3327)
- fix mounting / on LV
- fix mounting / on soft RAID or crypted LV (mga#3778 & mga#448)
- include xz for xz modules

Modified: drakx/trunk/rescue/guessmounts
===================================================================
--- drakx/trunk/rescue/guessmounts 2012-01-25 18:30:25 UTC (rev 2809)
+++ drakx/trunk/rescue/guessmounts 2012-01-25 18:30:29 UTC (rev 2810)
@@ -55,7 +55,7 @@
}

my @fstab;
-my ($root, @roots);
+my ($root, $fs, @roots);

foreach (@$normal_parts) {
my $dev = devices::make($_->{device});
@@ -68,7 +68,7 @@
my $release = chomp_(cat_("$target$release_file"));
print STDERR "=> found a $release root partition on $dev\n=> type $fs, version `\n";
@fstab = fs::read_fstab($target, '/etc/fstab');
- push @roots, { dev => $dev, release => $release };
+ push @roots, { dev => $dev, release => $release, fs => $fs };
}
system('umount', $target) == 0 or die "error unmounting $target\n";
}
@@ -76,10 +76,15 @@
# Try Mageia first:
if (@roots) {
@roots = map { @$_ } partition { $_->{release} =~ /Mageia/ } @roots;
- $root = first(@roots)->{dev};
+ my $selected = first(@roots);
+ $root = $selected->{dev};
+ $fs = $selected->{fs};
+ print STDERR "=> Selecting $root as root fs\n";
}

if ($root) {
+ system("mount -t $fs $root $target 2>/dev/null");
+
print STDERR "\nMounting other partitions from fstab on $target...\n";
foreach (@fstab) {
my ($valued_options, $options) = fs::mount_options::unpack($_);

Loading...