diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-03-14 09:25:40 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-03-14 09:25:40 +0000 |
commit | e2cbffc6422fc59ee624c2c399e79109c21c7cc4 (patch) | |
tree | 8bc16a2c6a23da765f7bd7ca08b5ad5dc676b6c5 /perl-install/loopback.pm | |
parent | 9266168309a593e84c47cc59edb2a6ccd49e4686 (diff) | |
download | drakx-backup-do-not-use-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar drakx-backup-do-not-use-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar.gz drakx-backup-do-not-use-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar.bz2 drakx-backup-do-not-use-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.tar.xz drakx-backup-do-not-use-e2cbffc6422fc59ee624c2c399e79109c21c7cc4.zip |
no_comment
Diffstat (limited to 'perl-install/loopback.pm')
-rw-r--r-- | perl-install/loopback.pm | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/perl-install/loopback.pm b/perl-install/loopback.pm index 32bb62b3a..04b3786ae 100644 --- a/perl-install/loopback.pm +++ b/perl-install/loopback.pm @@ -23,6 +23,28 @@ sub loopbacks { map { map { @{$_->{loopback} || []} } partition_table::get_normal_parts($_) } @_; } +sub carryRootLoopback { + my ($part) = @_; + $_->{mntpoint} eq '/' and return 1 foreach @{$part->{loopback} || []}; + 0; +} + +sub carryRootCreateSymlink { + my ($part, $prefix) = @_; + + carryRootLoopback($part) or return; + + my $mntpoint = "$prefix$part->{mntpoint}"; + unless (-e $mntpoint) { + eval { commands::mkdir_("-p", dirname($mntpoint)) }; + #- do non-relative link for install, should be changed to relative link before rebooting + symlink "/initrd/loopfs", $mntpoint; + } + #- indicate kernel to keep initrd + mkdir "$prefix/initrd", 0755; +} + + sub format_part { my ($part, $prefix) = @_; fs::mount_part($part->{device}, $prefix); @@ -37,6 +59,8 @@ sub create { return $f if -e $f; eval { commands::mkdir_("-p", dirname($f)) }; + + log::l("creating loopback file $f"); local *F; open F, ">$f" or die "failed to create loopback file"; @@ -49,8 +73,9 @@ sub create { sub getFree { my ($part, $prefix) = @_; - unless ($part->{freespace}) { - $part->{isFormatted} || !$part->{notFormatted} or return; + if ($part->{isFormatted} || !$part->{notFormatted}) { + $part->{freespace} = $part->{size}; + } elsif (!$part->{freespace}) { isMountableRW($part) or return; my $dir = "/tmp/loopback_tmp"; |