diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-03-28 17:47:42 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-03-28 17:47:42 +0000 |
commit | 82e7fa470773e0f2cca95d3f0ac76445960bdc89 (patch) | |
tree | 66c023446cb57a6f2fc86efecdb54daf9ca6c357 /perl-install/install/steps_interactive.pm | |
parent | 5a3539f4db4d5262c9090c35c1ee2273dd835123 (diff) | |
download | drakx-82e7fa470773e0f2cca95d3f0ac76445960bdc89.tar drakx-82e7fa470773e0f2cca95d3f0ac76445960bdc89.tar.gz drakx-82e7fa470773e0f2cca95d3f0ac76445960bdc89.tar.bz2 drakx-82e7fa470773e0f2cca95d3f0ac76445960bdc89.tar.xz drakx-82e7fa470773e0f2cca95d3f0ac76445960bdc89.zip |
- warn the user and propose to install/quit-install before upgrading from a
partition where "/" is ext3 with block-size 1KB to avoid kernel bug (#37583)
Diffstat (limited to 'perl-install/install/steps_interactive.pm')
-rw-r--r-- | perl-install/install/steps_interactive.pm | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/perl-install/install/steps_interactive.pm b/perl-install/install/steps_interactive.pm index 239b6c7bf..84984e32c 100644 --- a/perl-install/install/steps_interactive.pm +++ b/perl-install/install/steps_interactive.pm @@ -145,6 +145,11 @@ sub selectInstallClass { goto askInstallClass; } + _check_unsafe_upgrade_and_warn($o, $p->{part}) or $p = undef; + } + + if (ref $p) { + if ($p->{part}) { log::l("choosing to upgrade partition $p->{part}{device}"); $o->{migrate_device_names} = install::any::use_root_part($o->{all_hds}, $p->{part}, $o); @@ -169,6 +174,50 @@ sub selectInstallClass { } } +sub _check_unsafe_upgrade_and_warn { + my ($o, $part) = @_; + !_is_unsafe_upgrade($part) || _warn_unsafe_upgrade($o); +} +sub _is_unsafe_upgrade { + my ($part) = @_; + + my $r = run_program::get_stdout('dumpe2fs', devices::make($part->{device})); + my $block_size = $r =~ /^Block size:\s*(\d+)/m && $1; + log::l("block_size $block_size"); + $block_size == 1024; +} +sub _warn_unsafe_upgrade { + my ($o) = @_; + + log::l("_warn_unsafe_upgrade"); + + my @choices = ( + N_("Cancel installation, reboot system"), + N_("New Installation"), + N_("Upgrade previous installation (not recommended)"), + ); + + my $choice; + $o->ask_from_({ messages => N("Installer have detected your installed Mandriva Linux system could not +safely be upgraded to %s. + +New installation replacing your previous one is recommended. + +Warning : you should backup all your personal data before choosing \"New +Installation\".", 'Mandriva Linux 2008 Spring') }, + [ { val => \$choice, type => 'list', list => \@choices, format => \&translate } ]); + + log::l("_warn_unsafe_upgrade: got $choice"); + + if ($choice eq $choices[0]) { + any::reboot($o); + } elsif ($choice eq $choices[1]) { + undef; + } else { + 1; + } +} + #------------------------------------------------------------------------------ sub selectMouse { my ($o, $force) = @_; |