summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table/bsd.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/partition_table/bsd.pm')
-rw-r--r--perl-install/partition_table/bsd.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/perl-install/partition_table/bsd.pm b/perl-install/partition_table/bsd.pm
index 0e2421c25..ec2a2edf4 100644
--- a/perl-install/partition_table/bsd.pm
+++ b/perl-install/partition_table/bsd.pm
@@ -1,4 +1,4 @@
-package partition_table::bsd; # $Id$
+package partition_table::bsd;
use diagnostics;
use strict;
@@ -58,7 +58,10 @@ my $magic = 0x82564557;
my $nb_primary = 8;
my $offset = 0x40;
-sub read($$) {
+
+sub use_pt_type { 1 }
+
+sub read_one {
my ($hd, $sector) = @_;
my $tmp;
@@ -87,7 +90,7 @@ sub read($$) {
# write the partition table (and extended ones)
# for each entry, it uses fields: start, size, pt_type, active
sub write($$$;$) {
- my ($hd, $sector, $pt, $info) = @_;
+ my ($hd, $_handle, $sector, $pt, $info) = @_;
#- handle testing for writing partition table on file only!
my $F;
@@ -137,9 +140,10 @@ sub info {
};
}
-sub clear_raw {
- my ($hd) = @_;
- { raw => [ ({}) x $nb_primary ], info => info($hd) };
+sub initialize {
+ my ($class, $hd) = @_;
+ $hd->{primary} = { raw => [ ({}) x $nb_primary ], info => info($hd) };
+ bless $hd, $class;
}
sub first_usable_sector { 2048 }