summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/loopback.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perl-install/loopback.pm b/perl-install/loopback.pm
index 73a00f94a..24c519ecb 100644
--- a/perl-install/loopback.pm
+++ b/perl-install/loopback.pm
@@ -77,9 +77,12 @@ sub create {
log::l("creating loopback file $f ($part->{size} sectors)");
local *F;
+ my $block_size = 128;
+ my $s = "\0" x (512 * $block_size);
sysopen F, $f, 2 | c::O_CREAT() or die "failed to create loopback file";
- sysseek F, ($part->{size} << 9) - 1, 0 or die "failed to create loopback file";
- syswrite F, "\0" or die "failed to create loopback file";
+ for (my $i = 0; $i < $part->{size}; $i += $block_size) {
+ syswrite F, $s or die "failed to create loopback file";
+ }
}
sub getFree {