summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table_bsd.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-01-24 13:11:27 +0000
committerFrancois Pons <fpons@mandriva.com>2000-01-24 13:11:27 +0000
commitfe0e92f4e338bd3ab690e409ff9ccde6cfe58780 (patch)
tree90162d89089414633e30308971a9e715f1b1363c /perl-install/partition_table_bsd.pm
parent9e683c898b6592aaac1196f76dd9321c4426c912 (diff)
downloaddrakx-backup-do-not-use-fe0e92f4e338bd3ab690e409ff9ccde6cfe58780.tar
drakx-backup-do-not-use-fe0e92f4e338bd3ab690e409ff9ccde6cfe58780.tar.gz
drakx-backup-do-not-use-fe0e92f4e338bd3ab690e409ff9ccde6cfe58780.tar.bz2
drakx-backup-do-not-use-fe0e92f4e338bd3ab690e409ff9ccde6cfe58780.tar.xz
drakx-backup-do-not-use-fe0e92f4e338bd3ab690e409ff9ccde6cfe58780.zip
first sparc release of DrakX.
Diffstat (limited to 'perl-install/partition_table_bsd.pm')
-rw-r--r--perl-install/partition_table_bsd.pm19
1 files changed, 17 insertions, 2 deletions
diff --git a/perl-install/partition_table_bsd.pm b/perl-install/partition_table_bsd.pm
index f3134f4fb..c0af9cf48 100644
--- a/perl-install/partition_table_bsd.pm
+++ b/perl-install/partition_table_bsd.pm
@@ -56,6 +56,14 @@ my $magic = 0x82564557;
my $nb_primary = 8;
my $offset = 0x40;
+#- use default partition table adust functions.
+sub adjustStart($$) {
+ &partition_table::adjustStart;
+}
+sub adjustEnd($$) {
+ &partition_table::adjustEnd;
+}
+
sub read($$) {
my ($hd, $sector) = @_;
my $tmp;
@@ -89,8 +97,15 @@ sub read($$) {
sub write($$$;$) {
my ($hd, $sector, $pt, $info) = @_;
- local *F; partition_table_raw::openit($hd, *F, 2) or die "error opening device $hd->{device} for writing";
- c::lseek_sector(fileno(F), $sector, $offset) or return 0;
+ #- handle testing for writing partition table on file only!
+ local *F;
+ if ($::testing) {
+ my $file = "/tmp/partition_table_$hd->{device}";
+ open F, ">$file" or die "error opening test file $file";
+ } else {
+ partition_table_raw::openit($hd, *F, 2) or die "error opening device $hd->{device} for writing";
+ c::lseek_sector(fileno(F), $sector, $offset) or return 0;
+ }
#- TODO compute checksum