summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2020-06-16 16:42:54 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2020-06-16 17:24:38 +0100
commitf7b1790ec7cd12a8965b5e8fd5060e913db54edc (patch)
tree79dbd78650016a452b5796f2ae87020ff4f87d19 /perl-install
parentb0472581f467472c7e473bf892f6ec1184218182 (diff)
downloaddrakx-f7b1790ec7cd12a8965b5e8fd5060e913db54edc.tar
drakx-f7b1790ec7cd12a8965b5e8fd5060e913db54edc.tar.gz
drakx-f7b1790ec7cd12a8965b5e8fd5060e913db54edc.tar.bz2
drakx-f7b1790ec7cd12a8965b5e8fd5060e913db54edc.tar.xz
drakx-f7b1790ec7cd12a8965b5e8fd5060e913db54edc.zip
Ignore free space on other devices when allocating partitions on single device.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/fsedit.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index fc979ce87..e53648a37 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -346,7 +346,7 @@ sub is_one_big_fat_or_NT {
sub computeSize {
- my ($part, $best, $all_hds, $suggestions) = @_;
+ my ($part, $best, $all_hds, $suggestions, $o_target) = @_;
my $max = $part->{maxsize} || $part->{size};
return min($max, $best->{size}) unless $best->{ratio};
@@ -361,7 +361,7 @@ sub computeSize {
1;
} else { 0 } } @$suggestions;
- my $free_space = $best->{hd} && $free_space{$best->{hd}} || sum(values %free_space);
+ my $free_space = $o_target && $free_space{$o_target->{device}} || $best->{hd} && $free_space{$best->{hd}} || sum(values %free_space);
my $cylinder_size_maxsize_adjusted;
my $tot_ratios = 0;
@@ -392,7 +392,7 @@ sub computeSize {
}
sub suggest_part {
- my ($part, $all_hds, $o_suggestions) = @_;
+ my ($part, $all_hds, $o_suggestions, $o_target) = @_;
my $suggestions = $o_suggestions || $suggestions{server} || $suggestions{simple};
#- suggestions now use {fs_type}, but still keep compatibility
@@ -430,7 +430,7 @@ sub suggest_part {
$part->{mntpoint} = $best->{mntpoint};
fs::type::set_type_subpart($part, $best) if !isTrueFS($best) || !isTrueFS($part);
- $part->{size} = computeSize($part, $best, $all_hds, \@local_suggestions);
+ $part->{size} = computeSize($part, $best, $all_hds, \@local_suggestions, $o_target);
foreach ('options', 'lv_name', 'encrypt_key', 'primaryOrExtended',
'device_LABEL', 'prefer_device_LABEL', 'device_UUID', 'prefer_device_UUID', 'prefer_device') {
$part->{$_} = $best->{$_} if $best->{$_};
@@ -506,7 +506,7 @@ sub allocatePartitions {
next if $o_hd && (($o_hd->{device} || $o_hd->{VG_name}) ne $dev);
my ($part, $suggested);
while ($suggested = suggest_part($part = { start => $start, size => 0, maxsize => $size, rootDevice => $dev },
- $all_hds, \@to_add)) {
+ $all_hds, \@to_add, $o_hd)) {
my $hd = fs::get::part2hd($part, $all_hds);
add($hd, $part, $all_hds, { primaryOrExtended => $part->{primaryOrExtended} });
$size -= $part->{size} + $part->{start} - $start;