diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-09-19 16:39:50 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-09-19 16:39:50 +0000 |
commit | dcc8ce0c2edcc5ee9f271e985e8e2792e193fedb (patch) | |
tree | ffa3b441a308da20f10804b2dafcb5c5d02492e1 /perl-install | |
parent | a5a3495c25e6fdf906f569d735e08bdb32006347 (diff) | |
download | drakx-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
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/loopback.pm | 7 |
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 { |