diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-04-12 23:56:21 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-04-12 23:56:21 +0000 |
commit | 33876d96b93d796507af8dd46be3b9aba579d2b0 (patch) | |
tree | 2a6b030d080434295a126076b4727b891e5667e8 /perl-install/loopback.pm | |
parent | 66b03c87eb3e94bd4eb764d97cd7aaf3ca7f52f9 (diff) | |
download | drakx-33876d96b93d796507af8dd46be3b9aba579d2b0.tar drakx-33876d96b93d796507af8dd46be3b9aba579d2b0.tar.gz drakx-33876d96b93d796507af8dd46be3b9aba579d2b0.tar.bz2 drakx-33876d96b93d796507af8dd46be3b9aba579d2b0.tar.xz drakx-33876d96b93d796507af8dd46be3b9aba579d2b0.zip |
no_comment
Diffstat (limited to 'perl-install/loopback.pm')
-rw-r--r-- | perl-install/loopback.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/perl-install/loopback.pm b/perl-install/loopback.pm index baf8acd8f..17e8c40a6 100644 --- a/perl-install/loopback.pm +++ b/perl-install/loopback.pm @@ -40,8 +40,8 @@ sub carryRootCreateSymlink { #- do non-relative link for install, should be changed to relative link before rebooting symlink "/initrd/loopfs", $mntpoint; - mkdir "/initrd/loopfs/boot", 0755; - symlink "/initrd/loopfs/boot", "$prefix/boot"; + commands::mkdir_("-p", "/initrd/loopfs/lnx4win/boot"); + symlink "/initrd/loopfs/lnx4win/boot", "$prefix/boot"; } #- indicate kernel to keep initrd mkdir "$prefix/initrd", 0755; @@ -63,18 +63,18 @@ sub create { eval { commands::mkdir_("-p", dirname($f)) }; - log::l("creating loopback file $f"); - + log::l("creating loopback file $f ($part->{size} sectors)"); + unlink $f; + local *F; - open F, ">$f" or die "failed to create loopback file"; - for (my $nb = $part->{size}; $nb >= 0; $nb -= 8) { #- 8 * 512 = 4096 :) - print F "\0" x 4096; - } + 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"; $f; } sub inspect { - my ($part, $prefix) = @_; + my ($part, $prefix, $rw) = @_; isMountableRW($part) or return; @@ -86,7 +86,7 @@ sub inspect { $dir = ''; } else { mkdir $dir, 0700; - fs::mount($part->{device}, $dir, type2fs($part->{type}), 'rdonly'); + fs::mount($part->{device}, $dir, type2fs($part->{type}), !$rw); } my $h = before_leaving { if (!$part->{isMounted} && $dir) { |