summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-11-14 23:09:15 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-11-14 23:09:15 +0000
commit773013b8e45a6916a74ea64152e51fb6cb951920 (patch)
tree1fe018ccc96d5ddf11081ea8d57f263b3be6ae00 /perl-install/partition_table.pm
parent16caaa0fdfae2bdcec187bdffac3f12d7bb9a8a1 (diff)
downloaddrakx-backup-do-not-use-773013b8e45a6916a74ea64152e51fb6cb951920.tar
drakx-backup-do-not-use-773013b8e45a6916a74ea64152e51fb6cb951920.tar.gz
drakx-backup-do-not-use-773013b8e45a6916a74ea64152e51fb6cb951920.tar.bz2
drakx-backup-do-not-use-773013b8e45a6916a74ea64152e51fb6cb951920.tar.xz
drakx-backup-do-not-use-773013b8e45a6916a74ea64152e51fb6cb951920.zip
no_comment
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm13
1 files changed, 12 insertions, 1 deletions
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) = @_;