diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-12-18 12:19:48 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-12-18 12:19:48 +0000 |
commit | 575a03f47cd0de3af62c1b2f2685324943feb08a (patch) | |
tree | 9bfa52546c95d150f52074fb439c35abdcf6364d | |
parent | 2e45a61245d60946c6864f4d8eaeccec5f363ef9 (diff) | |
download | drakx-575a03f47cd0de3af62c1b2f2685324943feb08a.tar drakx-575a03f47cd0de3af62c1b2f2685324943feb08a.tar.gz drakx-575a03f47cd0de3af62c1b2f2685324943feb08a.tar.bz2 drakx-575a03f47cd0de3af62c1b2f2685324943feb08a.tar.xz drakx-575a03f47cd0de3af62c1b2f2685324943feb08a.zip |
allow auto allocating partitions without giving a {mntpoint}
-rw-r--r-- | perl-install/fsedit.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index ee2227538..ef632a9f7 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -346,7 +346,7 @@ sub suggest_part { my $has_swap = any { isSwap($_) } fs::get::fstab($all_hds); my @local_suggestions = - grep { !fs::get::has_mntpoint($_->{mntpoint}, $all_hds) || isSwap($_) && !$has_swap } + grep { !$_->{mntpoint} && !$_->{VG_name} || !fs::get::has_mntpoint($_->{mntpoint}, $all_hds) || isSwap($_) && !$has_swap } grep { !$_->{hd} || $_->{hd} eq $part->{rootDevice} } @$suggestions; @@ -364,7 +364,7 @@ sub suggest_part { foreach ('options', 'lv_name', 'encrypt_key', 'device_LABEL', 'prefer_device_LABEL', 'primaryOrExtended') { $part->{$_} = $best->{$_} if $best->{$_}; } - 1; + $best; } sub suggestions_mntpoint { @@ -431,15 +431,18 @@ sub add { sub allocatePartitions { my ($all_hds, $to_add) = @_; + my @to_add = @$to_add; + foreach my $part_ (fs::get::holes($all_hds)) { my ($start, $size, $dev) = @$part_{"start", "size", "rootDevice"}; - my $part; - while (suggest_part($part = { start => $start, size => 0, maxsize => $size, rootDevice => $dev }, - $all_hds, $to_add)) { + my ($part, $suggested); + while ($suggested = suggest_part($part = { start => $start, size => 0, maxsize => $size, rootDevice => $dev }, + $all_hds, \@to_add)) { my $hd = fs::get::part2hd($part, $all_hds); add($hd, $part, $all_hds, { primaryOrExtended => $part->{primaryOrExtended} }); $size -= $part->{size} + $part->{start} - $start; $start = $part->{start} + $part->{size}; + @to_add = grep { $_ != $suggested } @to_add; } } } |