summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-07-31 13:45:40 +0000
committerOlivier Blin <oblin@mandriva.com>2009-07-31 13:45:40 +0000
commitc984b52d4c3ec1c771daca9cb07a78470f525bd8 (patch)
treea26e7d30580d719beef974218bec178b7d8f1275
parent637c9dc0d7a80cb1e5551939637046fb57cb7555 (diff)
downloaddraklive-c984b52d4c3ec1c771daca9cb07a78470f525bd8.tar
draklive-c984b52d4c3ec1c771daca9cb07a78470f525bd8.tar.gz
draklive-c984b52d4c3ec1c771daca9cb07a78470f525bd8.tar.bz2
draklive-c984b52d4c3ec1c771daca9cb07a78470f525bd8.tar.xz
draklive-c984b52d4c3ec1c771daca9cb07a78470f525bd8.zip
correct slash size in supplement_partitions
-rwxr-xr-xdraklive4
-rw-r--r--lib/MDV/Draklive/Media.pm4
2 files changed, 5 insertions, 3 deletions
diff --git a/draklive b/draklive
index 141fc2c..b0bdee2 100755
--- a/draklive
+++ b/draklive
@@ -728,7 +728,7 @@ sub create_disk_master {
directory_usage($live->get_builddir . $live->{prefix}{build}{boot}) +
directory_usage($live->get_builddir . $live->{prefix}{build}{files}) +
70000000) :
- 200000000 + fold_left { $::a + $::b } map { $_->{size} * $common::SECTORSIZE } @{$live->{media}{partitions}};
+ fold_left { $::a + $::b } map { $_->{size} * $common::SECTORSIZE } @{$live->{media}{partitions}};
my @loops = allocate_master($live, $live->{media}, $dest, $disk_size);
my $slash_idx = $live->{media}->find_partition_index('/');
@@ -1120,7 +1120,7 @@ sub create_usb_replicator {
my $dest = get_disk_replicator_path($live);
my %files = get_disk_replicator_files($live);
- my $size = 8000000 + fold_left { $::a + $::b } map { directory_usage($_, 'apparent') } keys(%files);
+ my $size = fold_left { $::a + $::b } map { directory_usage($_, 'apparent') } keys(%files);
$live->{replicator}{media}->supplement_partitions($size);
my @loops = allocate_master($live, $live->{replicator}{media}, $dest, $size);
diff --git a/lib/MDV/Draklive/Media.pm b/lib/MDV/Draklive/Media.pm
index 278d463..4c7a7f4 100644
--- a/lib/MDV/Draklive/Media.pm
+++ b/lib/MDV/Draklive/Media.pm
@@ -59,7 +59,9 @@ sub supplement_partitions {
my $slash = find { $_->{mntpoint} eq '/' } @{$media->{partitions}};
$slash->{fs_type} ||= $media->get_media_setting('fs');
- $slash->{size} ||= $total_size / $common::SECTORSIZE;
+
+ my $correction = 1.2;
+ $slash->{size} ||= int($total_size * $correction) / $common::SECTORSIZE;
}
1;