From f8bb7913e2a6a73573e42b8f559656177ffe3892 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 28 Oct 2009 15:47:33 +0000 Subject: improve windows resizing when using free space from windows partition: - try to keep at least 1GB free for Windows - try to use from 6GB to 10% free space for Linux --- perl-install/fs/partitioning_wizard.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/perl-install/fs/partitioning_wizard.pm b/perl-install/fs/partitioning_wizard.pm index fc6bd4f96..da1830753 100644 --- a/perl-install/fs/partitioning_wizard.pm +++ b/perl-install/fs/partitioning_wizard.pm @@ -144,7 +144,16 @@ sub partitionWizardSolutions { $part->{resize_fat} = $resize_fat; $part->{min_win} = $min_win; $part->{min_linux} = $min_linux_all; - $part->{req_size} = $part->{size}; + #- try to keep at least 1GB free for Windows + #- try to use from 6GB to 10% free space for Linux + my $suggested_size = max( + $part->{min_win} + 1*MB(1024), + min( + $part->{size} - 0.1 * ($part->{size} - $part->{min_win}), + $part->{size} - 6*MB(1024), + ), + ); + $part->{req_size} = max(min($suggested_size, $part->{size} - $part->{min_linux}), $part->{min_win}); } } } -- cgit v1.2.1