summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-10-26 08:52:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-10-26 08:52:39 +0000
commit4663d4d881b76120f6e0e140a981c82044385ac9 (patch)
treed755942e9b42e7847f04fc781cb9470d83ad257c
parent1848925af2ca2cbfaac2bf7de39b007c314a01f7 (diff)
downloaddrakx-4663d4d881b76120f6e0e140a981c82044385ac9.tar
drakx-4663d4d881b76120f6e0e140a981c82044385ac9.tar.gz
drakx-4663d4d881b76120f6e0e140a981c82044385ac9.tar.bz2
drakx-4663d4d881b76120f6e0e140a981c82044385ac9.tar.xz
drakx-4663d4d881b76120f6e0e140a981c82044385ac9.zip
in upgrade, when we need to migrate device names, we must write the fstab
-rw-r--r--perl-install/install_any.pm5
-rw-r--r--perl-install/install_steps.pm2
-rw-r--r--perl-install/install_steps_interactive.pm2
3 files changed, 6 insertions, 3 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index eb174f8cb..2ac679a16 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -1375,6 +1375,7 @@ sub migrate_device_names {
sub use_root_part {
my ($all_hds, $part, $o_in) = @_;
+ my $migrate_device_names;
{
my $handle = any::inspect($part, $::prefix) or die;
@@ -1382,6 +1383,7 @@ sub use_root_part {
my $root_from_fstab = fs::get::root_(\@from_fstab);
if (!fsedit::is_same_hd($root_from_fstab, $part)) {
+ $migrate_device_names = 1;
log::l("from_fstab contained: $_->{device} $_->{mntpoint}") foreach @from_fstab;
migrate_device_names($all_hds, \@from_fstab, $part, $root_from_fstab, $o_in);
log::l("from_fstab now contains: $_->{device} $_->{mntpoint}") foreach @from_fstab;
@@ -1390,6 +1392,7 @@ sub use_root_part {
log::l("fstab is now: $_->{device} $_->{mntpoint}") foreach fs::get::fstab($all_hds);
}
isSwap($_) and $_->{mntpoint} = 'swap' foreach fs::get::really_all_fstab($all_hds); #- use all available swap.
+ $migrate_device_names;
}
sub getHds {
@@ -1504,7 +1507,7 @@ sub set_security {
sub write_fstab {
my ($o) = @_;
- fs::write_fstab($o->{all_hds}, $o->{prefix}) if !$o->{isUpgrade};
+ fs::write_fstab($o->{all_hds}, $o->{prefix}) if !$o->{isUpgrade} || $o->{migrate_device_names};
}
my @bigseldom_used_groups = (
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 3884f755c..6eb2e0ae7 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -170,7 +170,7 @@ sub selectInstallClass {
if ($o->{partitioning}{use_existing_root} || $o->{isUpgrade}) {
# either one root is defined (and all is ok), or we take the first one we find
my $p = fs::get::root_($o->{fstab}) || (first(install_any::find_root_parts($o->{fstab}, $o->{prefix})) || die)->{part};
- install_any::use_root_part($o->{all_hds}, $p);
+ $o->{migrate_device_names} = install_any::use_root_part($o->{all_hds}, $p);
}
}
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index fd49b78a0..13b2a4acf 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -162,7 +162,7 @@ sub selectInstallClass {
if (ref $p) {
my $part = $p->{part};
log::l("choosing to upgrade partition $part->{device}");
- install_any::use_root_part($o->{all_hds}, $part, $o);
+ $o->{migrate_device_names} = install_any::use_root_part($o->{all_hds}, $part, $o);
foreach (grep { $_->{mntpoint} } @{$o->{fstab}}) {
my ($options, $_unknown) = fs::mount_options::unpack($_);
$options->{encrypted} or next;