summaryrefslogtreecommitdiffstats
path: root/perl-install/install_interactive.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-01 13:07:07 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-01 13:07:07 +0000
commit22f8bb7c2e2df879af621cfd9bae36b90a9fd6d7 (patch)
treeb761bc2ce3b5d5c00f82080c06395294406b3785 /perl-install/install_interactive.pm
parent2e811de9845a12da69f075eb425506a8711977ca (diff)
downloaddrakx-backup-do-not-use-22f8bb7c2e2df879af621cfd9bae36b90a9fd6d7.tar
drakx-backup-do-not-use-22f8bb7c2e2df879af621cfd9bae36b90a9fd6d7.tar.gz
drakx-backup-do-not-use-22f8bb7c2e2df879af621cfd9bae36b90a9fd6d7.tar.bz2
drakx-backup-do-not-use-22f8bb7c2e2df879af621cfd9bae36b90a9fd6d7.tar.xz
drakx-backup-do-not-use-22f8bb7c2e2df879af621cfd9bae36b90a9fd6d7.zip
use from_Mb for choosing the size of the windows partition
Diffstat (limited to 'perl-install/install_interactive.pm')
-rw-r--r--perl-install/install_interactive.pm18
1 files changed, 15 insertions, 3 deletions
diff --git a/perl-install/install_interactive.pm b/perl-install/install_interactive.pm
index 72665c341..aad24c3a0 100644
--- a/perl-install/install_interactive.pm
+++ b/perl-install/install_interactive.pm
@@ -24,6 +24,17 @@ _("Some hardware on your computer needs ``proprietary'' drivers to work.
You can find some information about them at: %s", join(", ", @l))) if @l;
}
+#- unit of $mb is mega bytes, min and max are in sectors, this
+#- function is used to convert back to sectors count the size of
+#- a partition ($mb) given from the interface (on Resize or Create).
+#- modified to take into account a true bounding with min and max.
+sub from_Mb {
+ my ($mb, $min, $max) = @_;
+ $mb <= $min >> 11 and return $min;
+ $mb >= $max >> 11 and return $max;
+ $mb * 2048;
+}
+
sub partition_with_diskdrake {
my ($o, $all_hds, $nowizard) = @_;
my $ok;
@@ -132,11 +143,12 @@ under Windows (and optionally run defrag), then restart the
installation. You should also backup your data.
When sure, press Ok.")) or return;
- my $size = $part->{size};
+ my $mb_size = $part->{size} >> 11;
$o->ask_from('', _("Which size do you want to keep for windows on"), [
- { label => _("partition %s", partition_table::description($part)), val => \$size, min => $min_win >> 11, max => ($part->{size} - $min_linux - $min_swap) >> 11, type => 'range' },
+ { label => _("partition %s", partition_table::description($part)), val => \$mb_size, min => $min_win >> 11, max => ($part->{size} - $min_linux - $min_swap) >> 11, type => 'range' },
]) or return;
- $size <<= 11;
+
+ my $size = from_Mb($mb_size, $min_win, $part->{size});
local *log::l = sub { $w->set(join(' ', @_)) };
eval { $resize_fat->resize($size) };