summaryrefslogtreecommitdiffstats
path: root/perl-install/fs
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-10-28 15:47:33 +0000
committerOlivier Blin <oblin@mandriva.com>2009-10-28 15:47:33 +0000
commitf8bb7913e2a6a73573e42b8f559656177ffe3892 (patch)
tree2838bb2a522ff09460565dc67fcb163e05fd3981 /perl-install/fs
parent051da221073eba9c656872eb145829cb71f01e13 (diff)
downloaddrakx-backup-do-not-use-f8bb7913e2a6a73573e42b8f559656177ffe3892.tar
drakx-backup-do-not-use-f8bb7913e2a6a73573e42b8f559656177ffe3892.tar.gz
drakx-backup-do-not-use-f8bb7913e2a6a73573e42b8f559656177ffe3892.tar.bz2
drakx-backup-do-not-use-f8bb7913e2a6a73573e42b8f559656177ffe3892.tar.xz
drakx-backup-do-not-use-f8bb7913e2a6a73573e42b8f559656177ffe3892.zip
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
Diffstat (limited to 'perl-install/fs')
-rw-r--r--perl-install/fs/partitioning_wizard.pm11
1 files changed, 10 insertions, 1 deletions
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});
}
}
}