From bbf35d33eeb111f5f4ae69851bd26c03582e4b64 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Mon, 24 Jul 2000 13:41:37 +0000 Subject: *** empty log message *** --- perl-install/partition_table.pm | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'perl-install/partition_table.pm') diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index 03a3c9624..9d13745d5 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -368,18 +368,24 @@ sub get_holes($) { sub read_one($$) { my ($hd, $sector) = @_; - my ($pt, $info); - #- SUN bioses may blank disk or refuse to load it if the partition is unknown. - my @parttype = arch() =~ /^sparc/ ? ('sun', 'bsd', 'unknown') : ('dos', 'bsd', 'sun', 'mac', 'unknown'); - foreach ('empty', @parttype) { - /unknown/ and die "unknown partition table format"; - eval { - bless $hd, "partition_table_$_"; - ($pt, $info) = $hd->read($sector); - log::l("found a $_ partition table on $hd->{file}"); - }; - $@ or last; + + #- it can be safely considered that the first sector is used to probe the partition table + #- but other sectors (typically for extended partition ones) have to match this type! + if (!$sector) { + my @parttype = arch() =~ /^sparc/ ? ('sun', 'bsd', 'unknown') : ('dos', 'bsd', 'sun', 'mac', 'unknown'); + foreach ('empty', @parttype) { + /unknown/ and die "unknown partition table format"; + eval { + bless $hd, "partition_table_$_"; + ($pt, $info) = $hd->read($sector); + log::l("found a $_ partition table on $hd->{file} at sector $sector"); + }; + $@ or last; + } + } else { + #- keep current blessed object for that, this means it is neccessary to read sector 0 before. + ($pt, $info) = $hd->read($sector); } my @extended = $hd->hasExtended ? grep { isExtended($_) } @$pt : (); -- cgit v1.2.1