From 773013b8e45a6916a74ea64152e51fb6cb951920 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 14 Nov 1999 23:09:15 +0000 Subject: no_comment --- perl-install/partition_table.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'perl-install/partition_table.pm') diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 094481c3a..05d30b916 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -220,7 +220,7 @@ sub verifyInside($$) { sub verifyParts_ { foreach my $i (@_) { foreach (@_) { - $i != $_ and verifyNotOverlap($i, $_) || cdie "partitions sector #$i->{start} ($i->{size}bytes) and sector #$_->{start} ($_->{size}bytes) are overlapping!"; + $i != $_ and verifyNotOverlap($i, $_) || cdie sprintf "partitions sector #$i->{start} (%dMB) and sector #$_->{start} (%dMB) are overlapping!", $i->{size} >> 9, $_->{size} >> 9; }} } sub verifyParts($) { @@ -300,6 +300,17 @@ sub get_normal_parts($) { @{$hd->{primary}{normal} || []}, map { $_->{normal} } @{$hd->{extended} || []} } +sub get_holes($) { + my ($hd) = @_; + + my $start = 1; + map { + my $current = $start; + $start = $_->{start} + $_->{size}; + { start => $current, size => $_->{start} - $current } + } sort { $a->{start} <=> $b->{start} } get_normal_parts($hd), { start => $hd->{totalsectors}, size => 0 }; +} + sub read_one($$) { my ($hd, $sector) = @_; -- cgit v1.2.1