diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-03-11 01:11:06 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-03-11 01:11:06 +0000 |
commit | f39f307ded336dddb9a4767b1128b82471446412 (patch) | |
tree | 1b32019b5547e9706346c48fb34f8dfa062af865 /perl-install/fsedit.pm | |
parent | 39b16a6249eb865a2319a8e3cb1e4270e6fec539 (diff) | |
download | drakx-f39f307ded336dddb9a4767b1128b82471446412.tar drakx-f39f307ded336dddb9a4767b1128b82471446412.tar.gz drakx-f39f307ded336dddb9a4767b1128b82471446412.tar.bz2 drakx-f39f307ded336dddb9a4767b1128b82471446412.tar.xz drakx-f39f307ded336dddb9a4767b1128b82471446412.zip |
no_comment
Diffstat (limited to 'perl-install/fsedit.pm')
-rw-r--r-- | perl-install/fsedit.pm | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index 96d572cb5..e8b045d04 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -230,7 +230,7 @@ sub has_mntpoint($$) { #- do this before modifying $part->{mntpoint} #- $part->{mntpoint} should not be used here, use $mntpoint instead sub check_mntpoint { - my ($mntpoint, $hd, $part, $hds) = @_; + my ($mntpoint, $hd, $part, $hds, $loopbackDevice) = @_; $mntpoint eq '' || isSwap($part) || isRAID($part) and return; @@ -238,7 +238,23 @@ sub check_mntpoint { m|^/| or die _("Mount points must begin with a leading /"); #- m|(.)/$| and die "The mount point $_ is illegal.\nMount points may not end with a /"; - has_mntpoint($mntpoint, $hds) and die _("There is already a partition with mount point %s", $mntpoint); + has_mntpoint($mntpoint, $hds) and die _("There is already a partition with mount point %s\n", $mntpoint); + + my $fake_part = { mntpoint => $mntpoint, device => $loopbackDevice }; + $fake_part->{loopback_file} = 1 if $loopbackDevice; + my $fstab = [ get_fstab(@$hds), $fake_part ]; + my $check; $check = sub { + my ($p, @seen) = @_; + push @seen, $p->{mntpoint} || return; + @seen > 1 && $p->{mntpoint} eq $mntpoint and die _("Circular mounts %s\n", join(", ", @seen)); + if (my $part = fs::up_mount_point($p->{mntpoint}, $fstab)) { + $check->($part, @seen); + } + if (isLoopback($p)) { + $check->($p->{device}, @seen); + } + }; + $check->($fake_part); #- if ($part->{start} + $part->{size} > 1024 * $hd->cylinder_size() && arch() =~ /i386/) { #- die "/boot ending on cylinder > 1024" if $mntpoint eq "/boot"; @@ -267,12 +283,9 @@ sub allocatePartitions($$) { while (suggest_part($hd, $part = { start => $start, size => 0, maxsize => $size }, $hds, $to_add)) { - log::l("partsize " . ($part->{size}+ $part->{start})); - log::l("size " . ($size+ $start)); add($hd, $part, $hds); $size -= $part->{size} + $part->{start} - $start; $start = $part->{start} + $part->{size}; - log::l("size " . ($size+ $start)); } } } |