summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-19 16:39:50 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-19 16:39:50 +0000
commitdcc8ce0c2edcc5ee9f271e985e8e2792e193fedb (patch)
treeffa3b441a308da20f10804b2dafcb5c5d02492e1
parenta5a3495c25e6fdf906f569d735e08bdb32006347 (diff)
downloaddrakx-dcc8ce0c2edcc5ee9f271e985e8e2792e193fedb.tar
drakx-dcc8ce0c2edcc5ee9f271e985e8e2792e193fedb.tar.gz
drakx-dcc8ce0c2edcc5ee9f271e985e8e2792e193fedb.tar.bz2
drakx-dcc8ce0c2edcc5ee9f271e985e8e2792e193fedb.tar.xz
drakx-dcc8ce0c2edcc5ee9f271e985e8e2792e193fedb.zip
(create): don't use seek to create big files otherwise you get hole and
swapon doesn't like it
-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 {