summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-07-24 13:41:37 +0000
committerFrancois Pons <fpons@mandriva.com>2000-07-24 13:41:37 +0000
commitbbf35d33eeb111f5f4ae69851bd26c03582e4b64 (patch)
treedf210cf879e8702aea77f4c9f6bdc273cb002be7 /perl-install/partition_table.pm
parent13ca05864ed5e9c10b883888af73192150dc125a (diff)
downloaddrakx-backup-do-not-use-bbf35d33eeb111f5f4ae69851bd26c03582e4b64.tar
drakx-backup-do-not-use-bbf35d33eeb111f5f4ae69851bd26c03582e4b64.tar.gz
drakx-backup-do-not-use-bbf35d33eeb111f5f4ae69851bd26c03582e4b64.tar.bz2
drakx-backup-do-not-use-bbf35d33eeb111f5f4ae69851bd26c03582e4b64.tar.xz
drakx-backup-do-not-use-bbf35d33eeb111f5f4ae69851bd26c03582e4b64.zip
*** empty log message ***
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm28
1 files changed, 17 insertions, 11 deletions
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 : ();