From 75298521ee120412992df31ddd9f02338ff199fb Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 19 Oct 2001 15:11:54 +0000 Subject: fix ending is last sector, not next one --- perl-install/partition_table_gpt.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl-install/partition_table_gpt.pm b/perl-install/partition_table_gpt.pm index 134389cd8..3f30da4b9 100644 --- a/perl-install/partition_table_gpt.pm +++ b/perl-install/partition_table_gpt.pm @@ -110,7 +110,7 @@ sub read_partitionEntries { map { sysread $F, $tmp, psizeof($partitionEntry_format) or die "error while reading partition table in sector $info->{partitionEntriesLBA}"; my %h; @h{@$partitionEntry_fields} = unpack $partitionEntry_format, $tmp; - $h{size} = $h{ending} - $h{start}; + $h{size} = $h{ending} - $h{start} + 1; $h{type} = $gpt_types_rev{$h{gpt_type}}; $h{type} = 0x100 if !defined $h{type}; \%h; @@ -146,7 +146,7 @@ sub write { my ($hd, $sector, $pt, $info) = @_; foreach (@$pt) { - $_->{ending} = $_->{start} + $_->{size}; + $_->{ending} = $_->{start} + $_->{size} - 1; $_->{guid} ||= 'TODO'; $_->{gpt_type} = $gpt_types{$_->{type}} || $_->{gpt_type} || $gpt_types{0x83}; } -- cgit v1.2.1