| 414 |
if ($end != $start) { |
if ($end != $start) { |
| 415 |
|
|
| 416 |
# the end of the current range (may be the end of the disk or some |
# the end of the current range (may be the end of the disk or some |
| 417 |
# preserved partition |
# preserved partition or an ntfs volume to be resized) |
| 418 |
my $end_of_range = -1; |
my $end_of_range = -1; |
| 419 |
|
|
| 420 |
# minimum space required by all partitions, i.e., the lower ends of the |
# minimum space required by all partitions, i.e., the lower ends of the |
| 430 |
foreach my $p (@{$worklist}) { |
foreach my $p (@{$worklist}) { |
| 431 |
|
|
| 432 |
# we have found the delimiter |
# we have found the delimiter |
| 433 |
if ($FAI::configs{$config}{partitions}{$p}{size}{preserve}) { |
if ($FAI::configs{$config}{partitions}{$p}{size}{preserve} || |
| 434 |
|
($FAI::configs{$config}{partitions}{$p}{size}{resize} && |
| 435 |
|
($current_disk->{partitions}->{$p}->{filesystem} eq "ntfs"))) { |
| 436 |
$end_of_range = $current_disk->{partitions}->{$p}->{begin_byte}; |
$end_of_range = $current_disk->{partitions}->{$p}->{begin_byte}; |
| 437 |
|
|
| 438 |
# logical partitions require the space for the EPBR to be left |
# logical partitions require the space for the EPBR to be left |
| 502 |
$current_disk->{sector_size}; |
$current_disk->{sector_size}; |
| 503 |
} |
} |
| 504 |
|
|
| 505 |
# partition starts at where we currently are |
# partition starts at where we currently are, or remains fixed in case of |
| 506 |
|
# resized ntfs |
| 507 |
|
if ($FAI::configs{$config}{partitions}{$part_id}{size}{resize} && |
| 508 |
|
($current_disk->{partitions}->{$part_id}->{filesystem} eq "ntfs")) { |
| 509 |
|
($next_start <= $current_disk->{partitions}->{$part_id}->{begin_byte}) |
| 510 |
|
or die "Cannot preserve start byte of ntfs volume on partition $part_id, space before it is too small\n"; |
| 511 |
|
$next_start = $current_disk->{partitions}->{$part_id}->{begin_byte}; |
| 512 |
|
} |
| 513 |
$FAI::configs{$config}{partitions}{$part_id}{start_byte} = |
$FAI::configs{$config}{partitions}{$part_id}{start_byte} = |
| 514 |
$next_start; |
$next_start; |
| 515 |
|
|